rabbitmq-server.init-r3 638 B

1234567891011121314151617181920212223
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2013 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. depend() {
  5. need net
  6. use dns epmd
  7. }
  8. start() {
  9. ebegin "Starting RabbitMQ"
  10. /usr/sbin/rabbitmq-server -detached >> /var/log/rabbitmq/startup.log 2>> /var/log/rabbitmq/startup.err
  11. /usr/sbin/rabbitmqctl status | sed -n 's/[^p]*pid,\([0-9]*\)[^0-9]*/\1/p' > /var/run/rabbitmq.pid
  12. /usr/sbin/rabbitmqctl -q wait /var/run/rabbitmq.pid
  13. eend $?
  14. }
  15. stop() {
  16. ebegin "Stopping RabbitMQ"
  17. /usr/sbin/rabbitmqctl stop /var/run/rabbitmq.pid >> /var/log/rabbitmq/shutdown.log 2>> /var/log/rabbitmq/shutdown.err
  18. eend $?
  19. }