summaryrefslogtreecommitdiffstats
path: root/package/rabbitmq-server/S50rabbitmq-server
blob: faf248ded28b3da29a194b45fd714fcebf069f1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
#
# Start/stop rabbitmq-server
#

INSTALLUSER=rabbitmq
RUNDIR=/var/run/rabbitmq

case "$1" in
  start)
	install -d -o "$INSTALLUSER" -g "$INSTALLUSER" "$RUNDIR" || exit 1
        printf "Starting rabbitmq-server: "
        su -c "/usr/sbin/rabbitmq-server -detached" - "$INSTALLUSER" 2>/dev/null
        [ $? = 0 ] && echo "OK" || echo "FAIL"
	;;
  stop)
        printf "Stopping rabbitmq-server: "
        su -c "/usr/sbin/rabbitmqctl stop" - "$INSTALLUSER"
        [ $? = 0 ] && echo "OK" || echo "FAIL"
	;;
  restart|reload)
        "$0" stop || true
        "$0" start
	;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac
OpenPOWER on IntegriCloud