Package: nodm
Version: 0.11-1
Tags: patch

Running

   # service nodm status
   # echo $?

results in:

  [ ok ] Usage: /etc/init.d/nodm {start|stop|restart|force-reload}.
  1

Support for status would be nice to have. Additionaly, some
configuration management systems rely on this protocol [1]. Status code
1 says the service is not running, so a following start command is
expected to bring up a fresh service. Instead the old instance just
keeps running.

[1]
http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
diff --git a/debian/nodm.init b/debian/nodm.init
index c09768e..ca4340c 100644
--- a/debian/nodm.init
+++ b/debian/nodm.init
@@ -68,8 +68,11 @@ case "$1" in
 		$0 stop
 		$0 start
 		;;
+	status)
+		status_of_proc -p ${PIDFILE} /usr/sbin/nodm nodm && exit 0 || exit $?
+		;;
 	*)
-		log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
+		echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
 		exit 1
 		;;
 esac

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to