diff options
author | Nuno Santos <nsantos@apache.org> | 2008-04-01 21:41:23 +0000 |
---|---|---|
committer | Nuno Santos <nsantos@apache.org> | 2008-04-01 21:41:23 +0000 |
commit | aba8fc8b7efef5983e8794e58854c759a9391f22 (patch) | |
tree | 31fd90562c2f0c8437189875b15f1a232b60a4d5 /cpp | |
parent | 37a6dd4b29adb9262080bb987c8da751d8e94f55 (diff) | |
download | qpid-python-aba8fc8b7efef5983e8794e58854c759a9391f22.tar.gz |
QPID-892 - use daemon params instead of runuser; store pid of qpidd daemon to kill single instance
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@643597 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rwxr-xr-x | cpp/etc/qpidd | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/etc/qpidd b/cpp/etc/qpidd index 55d885ef66..d9076191d6 100755 --- a/cpp/etc/qpidd +++ b/cpp/etc/qpidd @@ -19,6 +19,7 @@ prog=qpidd lockfile=/var/lock/subsys/$prog +pidfile=/var/run/qpidd.pid # Source function library. . /etc/rc.d/init.d/functions @@ -31,19 +32,24 @@ RETVAL=0 start() { echo -n $"Starting Qpid AMQP daemon: " - daemon --check $prog "runuser -s /bin/sh qpidd -c \"$prog --daemon $QPIDD_OPTIONS\"" + daemon --pidfile $pidfile --check $prog --user qpidd $prog --daemon $QPIDD_OPTIONS RETVAL=$? 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 Qpid AMQP daemon: " - killproc $prog + killproc -p ${pidfile} $prog RETVAL=$? echo - [ $RETVAL = 0 ] && rm -f $lockfile + [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} } reload() { |