packages: rabbitmq-server/rabbitmq-server.init - pldized, works for me

zbyniu zbyniu at pld-linux.org
Wed Apr 27 18:12:10 CEST 2011


Author: zbyniu                       Date: Wed Apr 27 16:12:10 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- pldized, works for me

---- Files affected:
packages/rabbitmq-server:
   rabbitmq-server.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/rabbitmq-server/rabbitmq-server.init
diff -u packages/rabbitmq-server/rabbitmq-server.init:1.1 packages/rabbitmq-server/rabbitmq-server.init:1.2
--- packages/rabbitmq-server/rabbitmq-server.init:1.1	Mon Oct 25 23:34:23 2010
+++ packages/rabbitmq-server/rabbitmq-server.init	Wed Apr 27 18:12:05 2011
@@ -13,7 +13,7 @@
 # Source function library
 . /etc/rc.d/init.d/functions
 
-DAEMON=/usr/sbin/rabbitmq-multi
+DAEMON=/usr/sbin/rabbitmq-server
 USER=rabbitmq
 NODE_COUNT=1
 
@@ -24,13 +24,28 @@
 fi
 
 start() {
-	msg_starting "rabbitmq-server daemon"
-	daemon --user $USER $DAEMON start_all $NODE_COUNT
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/ejabberd ]; then
+		msg_starting "rabbitmq-server daemon"
+		daemon --user $USER $DAEMON start_all $NODE_COUNT -detached
+		RETVAL=$?
+		if [ $RETVAL -eq 0 ]; then
+			touch /var/lock/subsys/rabbitmq-server
+		fi
+	else
+		msg_already_running "rabbitmq-server daemon"
+	fi
 }
 
 stop() {
-	msg_stopping "rabbitmq-server daemon"
-	daemon --user $USER $DAEMON stop_all
+	# Stop daemons.
+	if [ -f /var/lock/subsys/rabbitmq-server ]; then
+		msg_stopping "rabbitmq-server daemon"
+		daemon --user $USER /usr/sbin/rabbitmqctl stop
+		rm -f /var/lock/subsys/rabbitmq-server
+	else
+		msg_not_running "rabbitmq-server daemon"
+	fi
 }
 
 RETVAL=0
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rabbitmq-server/rabbitmq-server.init?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list