[rhmessaging-commits] rhmessaging commits: r1829 - store/trunk/cpp/etc.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Apr 1 17:52:56 EDT 2008


Author: nunofsantos
Date: 2008-04-01 17:52:56 -0400 (Tue, 01 Apr 2008)
New Revision: 1829

Modified:
   store/trunk/cpp/etc/rhmd
Log:
better way to run as qpidd; use pid to kill single instance

Modified: store/trunk/cpp/etc/rhmd
===================================================================
--- store/trunk/cpp/etc/rhmd	2008-04-01 20:18:44 UTC (rev 1828)
+++ store/trunk/cpp/etc/rhmd	2008-04-01 21:52:56 UTC (rev 1829)
@@ -19,6 +19,7 @@
 
 prog=qpidd
 lockfile=/var/lock/subsys/rhmd
+pidfile=/var/run/rhmd.pid
 
 # Source function library.
 . /etc/rc.d/init.d/functions
@@ -31,20 +32,25 @@
 
 start() {
 	echo -n $"Starting RHM daemon: "
-	daemon --check $prog "runuser -s /bin/sh qpidd -c \"$prog --daemon --config=/etc/rhmd.conf\""
+	daemon --pidfile $pidfile --check $prog --user qpidd $prog --daemon --config=/etc/rhmd.conf
 	RETVAL=$?
         if [ $RETVAL = 0 ] ; then success ; else failure ; fi
 	echo
 	[ $RETVAL = 0 ] && touch $lockfile
+	if [ $RETVAL = 0 ]; then
+	    touch $pidfile
+	    chown qpidd.qpidd $pidfile
+	    runuser -s /bin/sh qpidd -c "qpidd -c > $pidfile"
+	fi
 	return $RETVAL
 }
 
 stop() {
 	echo -n $"Stopping RHM daemon: "
-	killproc $prog
+	killproc -p ${pidfile} $prog
 	RETVAL=$?
 	echo
-	[ $RETVAL = 0 ] && rm -f $lockfile
+	[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
 }
 
 reload() {




More information about the rhmessaging-commits mailing list