The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ejabberd / S50ejabberd
1 #!/bin/sh
2 #
3 # Start/stop ejabberd
4 #
5
6 NAME=ejabberd
7 USER=ejabberd
8 RUNDIR=/var/run/ejabberd
9 SPOOLDIR=/var/lib/ejabberd
10
11 # Read configuration variable file if it is present.
12 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
13
14 mkrundir() {
15     install -d -o "$USER" -g "$USER" "$RUNDIR" "$SPOOLDIR"
16 }
17
18 # Run ejabberdctl as user $USER.
19 ctl() {
20     su $USER -c "ejabberdctl $*"
21 }
22
23 case "$1" in
24     start)
25         mkrundir || exit 1
26         echo -n "Starting ejabberd... "
27         ctl start --spool "$SPOOLDIR"
28         # Wait until ejabberd is up and running.
29         if ctl started; then
30             echo "done"
31         else
32             echo "failed"
33         fi
34         ;;
35     stop)
36         echo -n "Stopping ejabberd... "
37         ctl stop > /dev/null
38         if [ $? -eq 3 ] || ctl stopped; then
39             echo "OK"
40         else
41             echo "failed"
42         fi
43         ;;
44     status)
45         ctl status
46         ;;
47     restart|force-reload)
48         "$0" stop
49         "$0" start
50         ;;
51     live)
52         mkrundir || exit 1
53         ctl live
54         ;;
55     *)
56         echo "Usage: $0 {start|stop|status|restart|force-reload|live}"
57         exit 1
58 esac