summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2011-05-24 23:46:25 +0200
committerBadlop <badlop@process-one.net>2011-05-24 23:46:44 +0200
commitf850bcbbc91377bf5ca2f4f98e8d953e1632157a (patch)
tree0a4d0ffdc288486a4f68d21a4afea681934417ee /src
parentWhen checking captcha setup, try to generate image only when captcha is enabl... (diff)
Several fixes and improvements in ejabberd.init.template
Changes: * Set script as executable * Add LSB tags and overrides, copied from Debian's ejabberd package * Add chkconfig support (thanks to Ivan Martinez)(EJAB-1450) * Don't use nounset, as that breaks when no argument is provided * Add status command
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in1
-rw-r--r--src/ejabberd.init.template25
2 files changed, 22 insertions, 4 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 4e561813..acdaf21c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -208,6 +208,7 @@ install: all
sed -e "s*@ctlscriptpath@*$(SBINDIR)*" \
-e "s*@installuser@*$(INIT_USER)*" ejabberd.init.template \
> ejabberd.init
+ chmod 555 ejabberd.init
#
# Binary Erlang files
install -d $(BEAMDIR)
diff --git a/src/ejabberd.init.template b/src/ejabberd.init.template
index 6659557b..ef691e4b 100644
--- a/src/ejabberd.init.template
+++ b/src/ejabberd.init.template
@@ -1,6 +1,20 @@
#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides: ejabberd
+# Required-Start: $remote_fs $network $named $time
+# Required-Stop: $remote_fs $network $named $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts ejabberd jabber server
+# Description: Starts ejabberd jabber server, an XMPP
+# compliant server written in Erlang.
+### END INIT INFO
+
+# chkconfig: 2345 90 10
+# description: ejabberd XMPP server
+
set -o errexit
-set -o nounset
DIR=@ctlscriptpath@
CTL="$DIR"/ejabberdctl
@@ -32,14 +46,17 @@ case "$1" in
su - $USER -c "$CTL stopped"
echo "done."
;;
-
+ status)
+ test -x "$CTL" || exit 0
+ echo "Getting ejabberd status..."
+ su - $USER -c "$CTL status"
+ ;;
force-reload|restart)
"$0" stop
"$0" start
;;
-
*)
- echo "Usage: $0 {start|stop|restart|force-reload}"
+ echo "Usage: $0 {start|stop|restart|force-reload|status}"
exit 1
esac