8 RUNDIR=/var/run/ejabberd
9 SPOOLDIR=/var/lib/ejabberd
11 # Read configuration variable file if it is present.
12 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
15 install -d -o "$USER" -g "$USER" "$RUNDIR" "$SPOOLDIR"
18 # Run ejabberdctl as user $USER.
20 su $USER -c "ejabberdctl $*"
26 echo -n "Starting ejabberd... "
27 ctl start --spool "$SPOOLDIR"
28 # Wait until ejabberd is up and running.
36 echo -n "Stopping ejabberd... "
38 if [ $? -eq 3 ] || ctl stopped; then
56 echo "Usage: $0 {start|stop|status|restart|force-reload|live}"