summaryrefslogtreecommitdiff
path: root/system/rabbitmq-server/rc.rabbitmq
diff options
context:
space:
mode:
authorAndre Barboza <bmg.andre@gmail.com>2015-12-31 00:04:44 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-12-31 00:04:44 +0700
commit56adb73145bcbb7a2ec49c6b7f1d8e61b83e837e (patch)
tree4d370c4ec875783cfb93c92f452004afb7c1eea4 /system/rabbitmq-server/rc.rabbitmq
parent8f452cfbfbb1ac4558c20213b7c01ae27a9bc357 (diff)
downloadslackbuilds-56adb73145bcbb7a2ec49c6b7f1d8e61b83e837e.tar.gz
system/rabbitmq-server: Added (multi-protocol messaging broker).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/rabbitmq-server/rc.rabbitmq')
-rw-r--r--system/rabbitmq-server/rc.rabbitmq45
1 files changed, 45 insertions, 0 deletions
diff --git a/system/rabbitmq-server/rc.rabbitmq b/system/rabbitmq-server/rc.rabbitmq
new file mode 100644
index 0000000000..9f6715bcc2
--- /dev/null
+++ b/system/rabbitmq-server/rc.rabbitmq
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Start/stop/restart Rabbit MQ daemon
+
+USER=rabbitmq
+DAEMON_START_OPTS="-detached"
+
+rabbitmq_start(){
+ sudo -u ${USER} sh -c "/usr/bin/rabbitmq-server ${DAEMON_START_OPTS}"
+}
+
+rabbitmq_stop() {
+ sudo -u ${USER} sh -c "/usr/bin/rabbitmqctl stop"
+}
+
+rabbitmq_restart() {
+ rabbitmq_stop
+ sleep 1
+ rabbitmq_start
+}
+
+rabbitmq_status() {
+ sudo -u ${USER} sh -c "/usr/bin/rabbitmqctl status"
+}
+
+print_usage() {
+ echo "usage $0 start|stop|restart|status"
+}
+
+case "$1" in
+ 'start')
+ rabbitmq_start
+ ;;
+ 'stop')
+ rabbitmq_stop
+ ;;
+ 'restart')
+ rabbitmq_restart
+ ;;
+ 'status')
+ rabbitmq_status
+ ;;
+ *)
+ print_usage
+ ;;
+esac