summaryrefslogtreecommitdiff
path: root/debian/smman.init.in
diff options
context:
space:
mode:
authorGuillaume Friloux <guillaume.friloux@gmail.com>2014-01-07 15:39:44 +0100
committerGuillaume Friloux <guillaume.friloux@gmail.com>2014-01-07 15:39:44 +0100
commit05c394bb8b50c30644b4c27a080190c2597f8c1b (patch)
treeca55780b971f4ac1bfa83c3e6d9a6a34f670589a /debian/smman.init.in
parentfeedcc4919feb92fb81f087b1c1b92fa958179eb (diff)
Add init script for debian.
Diffstat (limited to 'debian/smman.init.in')
-rw-r--r--debian/smman.init.in61
1 files changed, 61 insertions, 0 deletions
diff --git a/debian/smman.init.in b/debian/smman.init.in
new file mode 100644
index 0000000..1d963fd
--- /dev/null
+++ b/debian/smman.init.in
@@ -0,0 +1,61 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: smman
4# Required-Start: $syslog
5# Required-Stop: $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Start Smman the syslog manager.
9# Description: Start Smman the syslog manager.
10### END INIT INFO
11
12DAEMON=@prefix@/bin/smman
13DESC="smman"
14
15. /lib/lsb/init-functions
16
17if [ -f @sysconfdir@/default/smman ] ; then
18 . @sysconfdir@/default/smman
19fi
20set -e
21do_start() {
22 start-stop-daemon --start --background --oknodo --exec $DAEMON -- $DAEMON_OPTS
23}
24
25do_stop() {
26 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON --signal 9
27}
28
29do_restart() {
30 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON --signal USR1
31}
32
33case "$1" in
34 start)
35 log_daemon_msg "Starting $PROGRAM"
36 do_start
37 log_end_msg $?
38 ;;
39 stop)
40 log_daemon_msg "Stopping $PROGRAM"
41 do_stop
42 log_end_msg $?
43 ;;
44 restart|force-reload)
45 log_daemon_msg "Restarting $PROGRAM"
46 do_stop
47 sleep 1
48 do_start
49 log_end_msg $?
50 ;;
51 reload)
52 log_daemon_msg "Reloading $PROGRAM"
53 do_restart
54 log_end_msg $?
55 *)
56 log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload}" >&2
57 exit 1
58 ;;
59esac
60
61exit 0