[rabbitmq-discuss] Problem with rabbitmq-server.init

Sundar cybertoast at gmail.com
Wed Sep 26 16:52:57 BST 2012


The rabbitmq Fedora init script does not daemonize correctly (AFAICT). The
current script also does not match the Debian daemonization (using
start-stop-daemon).

Following is a patch to use "daemon" to make it work (I think). I'd
appreciate any feedback. I'm also not sure how to submit a pull/patch
request so if this is not the right place to submit this please could
someone point me to the right place. I cloned the code from
http://hg.rabbitmq.com/rabbitmq-server

Thanks much.

$ hg diff
diff -r 8792fb52db8a packaging/RPMS/Fedora/rabbitmq-server.init
--- a/packaging/RPMS/Fedora/rabbitmq-server.init    Wed Sep 26 13:57:55
2012 +0100
+++ b/packaging/RPMS/Fedora/rabbitmq-server.init    Wed Sep 26 11:44:21
2012 -0400
@@ -10,8 +10,6 @@
 # Provides:          rabbitmq-server
 # Required-Start:    $remote_fs $network
 # Required-Stop:     $remote_fs $network
-# Default-Start:     3 4 5
-# Default-Stop:      0 1 2 6
 # Description:       RabbitMQ broker
 # Short-Description: Enable AMQP service provided by RabbitMQ broker
 ### END INIT INFO
@@ -26,12 +24,16 @@
 INIT_LOG_DIR=/var/log/rabbitmq
 PID_FILE=/var/run/rabbitmq/pid

-START_PROG= # Set when building package
+START_PROG="daemon --user=$USER"
 LOCK_FILE=/var/lock/subsys/$NAME

 test -x $DAEMON || exit 0
 test -x $CONTROL || exit 0

+# Source function library for the "daemon" function
+. /etc/rc.d/init.d/functions
+
+
 RETVAL=0
 set -e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120926/6c8cc2cb/attachment.htm>


More information about the rabbitmq-discuss mailing list