[icinga-checkins] icinga.org: icinga-core/master: Modify the 'ps' flags to accomodate diffrenaces between *nix flavours

git at icinga.org git at icinga.org
Wed Nov 9 16:44:44 CET 2011


Module: icinga-core
Branch: master
Commit: e80a1d90428bdad4eb734bce9c9d650cf2968c28
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=e80a1d90428bdad4eb734bce9c9d650cf2968c28

Author: Assaf Flatto <icinga at flatto.net>
Date:   Fri Oct 28 10:13:46 2011 +0100

Modify the 'ps' flags to accomodate diffrenaces between *nix flavours

---

 daemon-init-redhat.in |    2 +-
 daemon-init.in        |    2 +-
 rc.ido2db.in          |    6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/daemon-init-redhat.in b/daemon-init-redhat.in
index 55f196c..823ed68 100644
--- a/daemon-init-redhat.in
+++ b/daemon-init-redhat.in
@@ -30,7 +30,7 @@ lockfile=/var/lock/subsys/$prog
 
 pid_lock() {
     if [ -e $pidfile ] ; then 
-	pproc=`ps auxww |grep (cat "$pidfile") `
+	pproc=`ps -ef |grep (cat "$pidfile") |grep -v grep `
 	echo "Icinga Process PID file present"
 	 if [ -z $pproc ] ; then 
 	    rm -f $pidfile
diff --git a/daemon-init.in b/daemon-init.in
index 47fcb48..e0c2170 100644
--- a/daemon-init.in
+++ b/daemon-init.in
@@ -100,7 +100,7 @@ pid_icinga ()
 		echo "Icinga not running. No lock file found in $IcingaRunFile"
 		exit 1
 	elif [ -e $IcingaRunFile ] ; then
-    	    pproc=`ps auxww |grep $IcingaPID `
+    	    pproc=`ps -ef |grep $IcingaPID |grep -v grep `
     	    echo "Icinga Process PID file present"
     	     if [ -z $pproc ] ; then
         	rm -f $IcingaRunFile
diff --git a/rc.ido2db.in b/rc.ido2db.in
index 3ee3d08..e41eade 100644
--- a/rc.ido2db.in
+++ b/rc.ido2db.in
@@ -101,9 +101,9 @@ status_ido2db ()
 ido2db_procs ()
 {
         pid_ido2db
-#	        PARENT=`ps ef |grep pid_ido2db |grep -v grep`
-	PCHILD=`ps auxf |grep ido2db |grep -v grep |grep \_ |wc -l`
-	PID_LIST=`ps auxf |grep ido2db |grep -v grep |grep \_ |awk {'print $2'}| tr '\n' ' '`
+#	        PARENT=`ps -ef |grep pid_ido2db |grep -v grep`
+	PCHILD=`ps -ef |grep ido2db |grep -v grep |grep \_ |wc -l`
+	PID_LIST=`ps -ef |grep ido2db |grep -v grep |grep \_ |awk {'print $2'}| tr '\n' ' '`
 }
 		
 





More information about the icinga-checkins mailing list