summaryrefslogtreecommitdiff
blob: 0a9aaf1adebee27257d93df962b36882922ace45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need net
	use dns epmd
}

start() {
	ebegin "Starting RabbitMQ"
	/usr/sbin/rabbitmq-server -detached >> /var/log/rabbitmq/startup.log 2>> /var/log/rabbitmq/startup.err
	/usr/sbin/rabbitmqctl status | sed -n 's/[^p]*pid,\([0-9]*\)[^0-9]*/\1/p' > /var/run/rabbitmq.pid
	/usr/sbin/rabbitmqctl -q wait /var/run/rabbitmq.pid
	eend $?
}

stop() {
	ebegin "Stopping RabbitMQ"
	/usr/sbin/rabbitmqctl stop /var/run/rabbitmq.pid >> /var/log/rabbitmq/shutdown.log 2>> /var/log/rabbitmq/shutdown.err
	eend $?
}