diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 1190a53506..f3f65aa9c7 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,4 +1,6 @@ 2007-08-23 Sancho Lerena + + * Fixed a BUG in daemon launcher scripts that makes to do not stop servers :( * Added a updated README. diff --git a/pandora_server/pandora_network b/pandora_server/pandora_network index 57a1df5584..6b76b26721 100755 --- a/pandora_server/pandora_network +++ b/pandora_server/pandora_network @@ -42,7 +42,7 @@ case "$1" in $PANDORA_DAEMON $PANDORA_HOME -D sleep 1 - MYPID=`ps aux | grep 'pandora_network' | grep -v grep | tail -1 | awk '{print $2}'` + MYPID=`ps aux | grep "$PANDORA_DAEMON" | grep -v grep | tail -1 | awk '{ print $2 }'` if [ ! -z "$MYPID" ] then echo $MYPID > $PANDORA_PID @@ -60,6 +60,8 @@ case "$1" in if [ ! -z "`ps -F -p $PID_2 | grep -v grep | grep 'pandora_network' `" ] then kill `cat $PANDORA_PID` 2> /dev/null > /dev/null + else + echo "Pandora FMS Network Server is not executing with PID $PID_2, skip Killing step" fi rm -f $PANDORA_PID else diff --git a/pandora_server/pandora_recon b/pandora_server/pandora_recon index 6d01287733..4d55f8e76c 100755 --- a/pandora_server/pandora_recon +++ b/pandora_server/pandora_recon @@ -42,7 +42,7 @@ case "$1" in $PANDORA_DAEMON $PANDORA_HOME -D sleep 1 - MYPID=`ps aux | grep 'pandora_recon' | grep -v grep | tail -1 | awk '{print $2}'` + MYPID=`ps aux | grep "$PANDORA_DAEMON" | grep -v grep | tail -1 | awk '{print $2}'` if [ ! -z "$MYPID" ] then echo $MYPID > $PANDORA_PID diff --git a/pandora_server/pandora_server b/pandora_server/pandora_server index 77d1dfd4bb..01e1cc1daf 100755 --- a/pandora_server/pandora_server +++ b/pandora_server/pandora_server @@ -42,7 +42,7 @@ case "$1" in $PANDORA_DAEMON $PANDORA_HOME -D sleep 1 - MYPID=`ps aux | grep 'pandora_server' | grep -v grep | tail -1 | awk '{print $2}'` + MYPID=`ps aux | grep "$PANDORA_DAEMON" | grep -v grep | tail -1 | awk '{print $2}'` if [ ! -z "$MYPID" ] then echo $MYPID > $PANDORA_PID diff --git a/pandora_server/pandora_snmpconsole b/pandora_server/pandora_snmpconsole index 1ff7789be1..f979240aee 100755 --- a/pandora_server/pandora_snmpconsole +++ b/pandora_server/pandora_snmpconsole @@ -47,7 +47,7 @@ case "$1" in fi fi - SNMP_WARNING=`ps aux | grep "snmptrapd" | grep -v grep | wc -l` + SNMP_WARNING=`ps aux | grep "$DAEMON_PATH" | grep -v grep | wc -l` if [ $SNMP_WARNING == 1 ] then echo "WARNING: Seems to be already running a SNMP trap daemon on this system not associated with Pandora FMS" @@ -101,7 +101,7 @@ case "$1" in $PANDORA_DAEMON $PANDORA_HOME -D sleep 1 - MYPID=`ps aux | grep 'pandora_snmpconsole' | grep -v grep | tail -1 | awk '{print $2}'` + MYPID=`ps aux | grep "$PANDORA_DAEMON" | grep -v grep | tail -1 | awk '{print $2}'` if [ ! -z "$MYPID" ] then echo $MYPID > $PANDORA_PID