17 |
|
|
18 |
. /etc/rc.d/init.d/functions |
. /etc/rc.d/init.d/functions |
19 |
|
|
20 |
node=`hostname | cut -d. -f1` |
node=`hostname -s` |
21 |
|
|
22 |
start() { |
start() { |
23 |
echo -n $"Starting ejabberd: " |
echo -n $"Starting ejabberd: " |
24 |
daemon --user=ejabberd --check=ejabberd \ |
daemon --user=ejabberd --check=ejabberd \ |
25 |
"erl" "-pa @libdir@/ejabberd-@version@/ebin \ |
"erl" "-pa @libdir@/ejabberd/ebin \ |
26 |
-sname ejabberd \ |
-sname ejabberd \ |
27 |
-s ejabberd \ |
-s ejabberd \ |
28 |
-ejabberd config \\\"/etc/ejabberd/ejabberd.cfg\\\" \ |
-ejabberd config \\\"/etc/ejabberd/ejabberd.cfg\\\" \ |
40 |
stop() { |
stop() { |
41 |
# Stop daemons. |
# Stop daemons. |
42 |
echo -n "Shutting down ejabberd: " |
echo -n "Shutting down ejabberd: " |
43 |
/sbin/runuser -s /bin/bash - ejabberd -c "erl -pa @libdir@/ejabberd-@version@/ebin -noinput -sname ejabberdctl -s ejabberd_ctl -extra ejabberd@$node stop" && success || failure |
/sbin/runuser -s /bin/bash - ejabberd -c "erl -pa @libdir@/ejabberd/ebin -noinput -sname ejabberdctl -s ejabberd_ctl -extra ejabberd@$node stop" && success || failure |
44 |
RETVAL=$? |
RETVAL=$? |
45 |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ejabberd |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ejabberd |
46 |
echo |
echo |
74 |
[ -f /var/lock/subsys/ejabberd ] && restart || : |
[ -f /var/lock/subsys/ejabberd ] && restart || : |
75 |
;; |
;; |
76 |
status) |
status) |
77 |
/sbin/runuser -s /bin/bash - ejabberd -c "erl -pa @libdir@/ejabberd-@version@/ebin -noinput -sname ejabberdctl -s ejabberd_ctl -extra ejabberd@$node status" |
/sbin/runuser -s /bin/bash - ejabberd -c "erl -pa @libdir@/ejabberd/ebin -noinput -sname ejabberdctl -s ejabberd_ctl -extra ejabberd@$node status" |
78 |
;; |
;; |
79 |
*) |
*) |
80 |
echo "Usage: ejabberd {start|stop|restart|force-reload|condrestart|try-restart|status}" |
echo "Usage: ejabberd {start|stop|restart|force-reload|condrestart|try-restart|status}" |