diff options
author | Nathan Johnson <njohnson@ena.com> | 2016-06-20 17:12:16 -0500 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-07-20 10:18:02 +0000 |
commit | d1d0a5c720de8a2f69b743859b7e3d9fcb2af948 (patch) | |
tree | 305860732777f2147c002b1ca29ca2270b891302 /testing/rabbitmq-server/rabbitmq-server.initd | |
parent | c7de92e9705aaac8452be02506677bf8bc6f6cbd (diff) | |
download | aports-d1d0a5c720de8a2f69b743859b7e3d9fcb2af948.tar.bz2 aports-d1d0a5c720de8a2f69b743859b7e3d9fcb2af948.tar.xz |
testing/rabbitmq-server: new aport
https://www.rabbitmq.com
RabbitMQ is an open source multi-protocol messaging broker.
Diffstat (limited to 'testing/rabbitmq-server/rabbitmq-server.initd')
-rw-r--r-- | testing/rabbitmq-server/rabbitmq-server.initd | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/rabbitmq-server/rabbitmq-server.initd b/testing/rabbitmq-server/rabbitmq-server.initd new file mode 100644 index 0000000000..5845635e74 --- /dev/null +++ b/testing/rabbitmq-server/rabbitmq-server.initd @@ -0,0 +1,42 @@ +#!/sbin/openrc-run + +pidfile=/run/rabbitmq/rabbitmq.pid +name=rabbitmq +daemon=/usr/sbin/rabbitmq-server + +startup_log=/var/log/rabbitmq/startup_log +startup_err=/var/log/rabbitmq/startup_err +shutdown_log=/var/log/rabbitmq/shutdown_log +shutdown_err=/var/log/rabbitmq/shutdown_err + +depend() { + need net localmount + after firewall +} + +start() { + ebegin "Starting ${name}" + # We need to test if /var/run/rabbitmq exists, since scirpt will fail if it does not + checkpath -m 700 -o rabbitmq:rabbitmq -d "$(dirname "$pidfile")" + checkpath -m 644 -o rabbitmq:rabbitmq --file-truncate -f $startup_log + checkpath -m 644 -o rabbitmq:rabbitmq --file-truncate -f $startup_err + start-stop-daemon --start \ + --env RABBITMQ_PID_FILE=$pidfile \ + --pidfile $pidfile \ + --stdout $startup_log \ + --stderr $startup_err \ + --background $daemon + eend $? +} + +stop() { + ebegin "Stopping ${name}" + checkpath -m 644 -o rabbitmq:rabbitmq --file-truncate -f $shutdown_log + checkpath -m 644 -o rabbitmq:rabbitmq --file-truncate -f $shutdown_err + start-stop-daemon --stop --quiet --pidfile $pidfile \ + --exec /bin/sh -- -c "/usr/sbin/rabbitmqctl \ + --stop $pidfile > $shutdown_log \ + 2> $shutdown_err" + eend $? +} + |