[Pkg-nagios-devel] nagios changelog,1.21,1.22 nagios-common.nagios.init,1.1,1.2

seanius@haydn.debian.org seanius@haydn.debian.org


Update of /cvsroot/pkg-nagios/nagios
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv25312

Modified Files:
	changelog nagios-common.nagios.init 
Log Message:
    - init script has a better check for running nagios processes.  really,
      we should be use start-stop-daemon, but this will work for
      the time being.  thanks again, Olaf.  (Closes: #283875)


Index: changelog
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/changelog,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- changelog	2 Dec 2004 02:43:55 -0000	1.21
+++ changelog	2 Dec 2004 17:07:10 -0000	1.22
@@ -14,8 +14,11 @@
     - everything in hosts.cfg was duplicated because of a bug in the
       postinst for nagios-common.  fixed.  thanks again to Olaf.
       (Closes: #283870).
+    - init script has a better check for running nagios processes.  really,
+      we should be use start-stop-daemon, but this will work for
+      the time being.  thanks again, Olaf.  (Closes: #283875)
 
- -- Sean Finney <seanius@debian.org>  Wed, 24 Nov 2004 23:50:53 -0500
+ -- Sean Finney <seanius@debian.org>  Thu, 02 Dec 2004 12:05:10 -0500
 
 nagios (2:1.3-0+pre4) unstable; urgency=low
 

Index: nagios-common.nagios.init
===================================================================
RCS file: /cvsroot/pkg-nagios/nagios/nagios-common.nagios.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- nagios-common.nagios.init	14 Nov 2004 23:11:58 -0000	1.1
+++ nagios-common.nagios.init	2 Dec 2004 17:07:11 -0000	1.2
@@ -50,10 +50,13 @@
 	fi
     elif [ -f $PIDFILE ]; then
     	# Try discovering if nagios is alive checking its pid
-	if kill -CHLD $( cat $PIDFILE ) ; then
-	    return 1    # Isn't started
+	pid=`cat $PIDFILE`
+	if [ "$pid" ]; then
+		if ps $pid >/dev/null; then
+			return 0    # Is started
+		fi
 	else
-	    return 0    # Is started
+	    return 1    # Isn't started
 	fi
     else
     	return 1	# Isn't started