From 76480f472ed2e39a4b7b307e0e6cccfbfbc6f5f9 Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Thu, 18 Oct 2012 10:55:43 -0500 Subject: Fix bcfg2-report-collector initscript pidof does not exist on rhel5 stop functions incorrectly set /var/lock/subsys/bcfg2-report-collector killproc used the wrong syntax --- debian/bcfg2-report-collector.init | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/debian/bcfg2-report-collector.init b/debian/bcfg2-report-collector.init index d3ef6dcc5..2d182385a 100755 --- a/debian/bcfg2-report-collector.init +++ b/debian/bcfg2-report-collector.init @@ -50,15 +50,14 @@ start () { stop () { echo -n "Stopping Configuration Report Collector: " if [ -f $PIDFILE ]; then - PID=`cat $PIDFILE | tr -d -c '0-9'` - killproc -p $PID ${BINARY} + killproc -p $PIDFILE ${BINARY} else killproc ${BINARY} fi STATUS=$? if [ "$STATUS" = 0 ]; then log_success_msg "bcfg2-report-collector" - test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-report-collector + test -e /var/lock/subsys/bcfg2-report-collector && rm /var/lock/subsys/bcfg2-report-collector else log_failure_msg "bcfg2-report-collector" fi @@ -66,8 +65,7 @@ stop () { } status () { - # Inspired by redhat /etc/init.d/functions status() call - PID=$(pidof -x $BINARY -o %PPID) + PID=$(pidofproc -p "$PIDFILE" $BINARY) if [ -n "$PID" ]; then echo "$BINARY (pid $PID) is running..." return 0 -- cgit v1.2.3-1-g7c22