summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Friloux <guillaume.friloux@gmail.com>2014-02-10 16:28:08 +0100
committerGuillaume Friloux <guillaume.friloux@gmail.com>2014-02-10 16:28:08 +0100
commitcc7755adb392bfc03e8b5ed2954d0593fd79f9ce (patch)
treea49208310c0847bcec9000b3dd663fbd0e966847
parent42592e472a67e5ae5f399cb9ebc8abdf5e22a0cb (diff)
Add status in init file for debian.
-rw-r--r--debian/smman.init.in12
1 files changed, 8 insertions, 4 deletions
diff --git a/debian/smman.init.in b/debian/smman.init.in
index e082316..5795194 100644
--- a/debian/smman.init.in
+++ b/debian/smman.init.in
@@ -11,6 +11,7 @@
11 11
12DAEMON=@prefix@/bin/smman 12DAEMON=@prefix@/bin/smman
13DESC="smman" 13DESC="smman"
14PID=/var/run/smman.pid
14 15
15. /lib/lsb/init-functions 16. /lib/lsb/init-functions
16 17
@@ -19,15 +20,15 @@ if [ -f @sysconfdir@/default/smman ] ; then
19fi 20fi
20set -e 21set -e
21do_start() { 22do_start() {
22 start-stop-daemon --start --background --oknodo --exec $DAEMON -- $DAEMON_OPTS 23 start-stop-daemon --start --background --oknodo --exec $DAEMON -- $DAEMON_OPTS --pidfile ${PID}
23} 24}
24 25
25do_stop() { 26do_stop() {
26 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON --signal 9 27 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON --signal 9 --pidfile ${PID}
27} 28}
28 29
29do_restart() { 30do_restart() {
30 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON --signal USR1 31 start-stop-daemon --stop --oknodo --quiet --exec $DAEMON --signal USR1 --pidfile ${PID}
31} 32}
32 33
33case "$1" in 34case "$1" in
@@ -53,8 +54,11 @@ case "$1" in
53 do_restart 54 do_restart
54 log_end_msg $? 55 log_end_msg $?
55 ;; 56 ;;
57 status)
58 status_of_proc -p ${PID} ${DAEMON} smman && echo 0 || exit $?
59 ;;
56 *) 60 *)
57 log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload}" >&2 61 log_success_msg "Usage: $0 {start|stop|restart|force-reload|reload|status}" >&2
58 exit 1 62 exit 1
59 ;; 63 ;;
60esac 64esac