Package: ejabberd
Version: 2.1.10-4+deb7u1
Tags: patch

The ejabberd init script does not have a "status" action. This prevents it from giving a meaningful response, for example, to "service --status-all". Other tools out there (e.g. salt) also expect "status" to exist, though I realize that doesn't mean "status" should definitively be implemented.

The attached patch simply adds a "status" action that simply uses "ctl status" (i.e. ejabberdctl status) to check and report the status.

-Steve

=== modified file 'init.d/ejabberd'
--- init.d/ejabberd	2010-03-23 21:16:58 +0000
+++ init.d/ejabberd	2014-04-09 22:41:49 +0000
@@ -133,8 +133,15 @@
 	    live
 	fi
     ;;
+    status)
+	if ctl status ; then
+	    echo -n "ejabberd is running"
+	else
+	    echo -n "ejabberd is stopped"
+	fi
+    ;;
     *)
-	echo "Usage: $0 {start|stop|restart|force-reload|live}" >&2
+	echo "Usage: $0 {start|stop|restart|force-reload|live|status}" >&2
 	exit 1
     ;;
 esac

Reply via email to