[omd-commits] OMD Git: omd: Code cleanup; Fixed problem with low process ids during running proc detection

git version control git at mathias-kettner.de
Mon Dec 20 12:25:52 CET 2010


Module: omd
Branch: master
Commit: 5552b070cd661e3ac172080a18d885a7917d14e1
URL:    http://omdistro.org/projects/omd/repository/revisions/5552b070cd661e3ac172080a18d885a7917d14e1

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Mon Dec 20 12:00:29 2010 +0100

Code cleanup; Fixed problem with low process ids during running proc detection

---

 packages/nagios/skel/etc/init.d/nagios |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/packages/nagios/skel/etc/init.d/nagios b/packages/nagios/skel/etc/init.d/nagios
index d42a2bc..e4c69bc 100755
--- a/packages/nagios/skel/etc/init.d/nagios
+++ b/packages/nagios/skel/etc/init.d/nagios
@@ -67,7 +67,7 @@ esac
 nagios_proc() {
     PROC=$(ps -u $USR --ppid 1 -o pid,cmd \
              | grep "$BIN -d $CFG_FILE" 2>&1 | grep -v grep)
-    PID=$(echo "$PROC" | sed 's/^ //g' | cut -d' ' -f1)
+    PID=$(echo "$PROC" | sed 's/^ *//g' | cut -d' ' -f1)
     if [ "$PID" != "" ]; then
         echo "$PID"
         return 0
@@ -84,16 +84,6 @@ nagios_proc() {
 pidof_nagios() {
     nagios_proc
     return $?
-    
-    if [ -e "$PID_FILE" ]; then
-        PID=$(cat "$PID_FILE")
-        [ -z "$PID" ] && return 1
-        if ps $PID >/dev/null 2>&1; then
-            echo $PID
-            return 0
-        fi
-    fi
-    return 1
 }
 
 verify_config() {



More information about the omd-commits mailing list