summaryrefslogtreecommitdiff
path: root/debian/smman.init.in
blob: cd83da17eede0a4ccc0a10039cee00a62c2e79c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
### BEGIN INIT INFO
# Provides: smman
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start:  2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start Smman the syslog manager.
# Description: Start Smman the syslog manager.
### END INIT INFO

DAEMON=@prefix@/bin/smman
DESC="smman"
PID=/var/run/smman.pid

. /lib/lsb/init-functions

if [ -f @sysconfdir@/default/smman ] ; then
   . @sysconfdir@/default/smman
fi
set -e
do_start() {
   start-stop-daemon --start --background --oknodo --make-pidfile --pidfile ${PID} --exec $DAEMON -- $DAEMON_OPTS
}

do_stop() {
   start-stop-daemon --stop --oknodo --quiet --exec $DAEMON  --signal 9 --pidfile ${PID}
}

do_restart() {
   start-stop-daemon --stop --oknodo --quiet --exec $DAEMON  --signal USR1 --pidfile ${PID}
}

case "$1" in
  start)
   log_daemon_msg "Starting $PROGRAM"
   do_start
   log_end_msg $?
   ;;
  stop)
   log_daemon_msg "Stopping $PROGRAM"
   do_stop
   log_end_msg $?
   ;;
  restart|force-reload)
   log_daemon_msg "Restarting $PROGRAM"
   do_stop
   sleep 1
   do_start
   log_end_msg $?
   ;;
  reload)
   log_daemon_msg "Reloading $PROGRAM"
   do_restart
   log_end_msg $?
   ;;
  status)
   status_of_proc -p ${PID} ${DAEMON} smman && echo 0 || exit $?
   ;;
  *)
   log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload|status}" >&2
   exit 1
   ;;
esac

exit 0