[Pkg-nagios-devel] Bug#476466: a rough patch for this issue

Stephen Gran sgran at debian.org
Mon Apr 28 11:22:13 UTC 2008


Package: nagios2
Version: 2.11-1
Followup-For: Bug #476466

The problem is that killproc does not always wait, or does not wait long
enough at any rate.  The following is my local hack around, with some
comments from IRC.

12:14 < sgran> Ganneff: would you consider a patch like http://paste.debian.net/1734/ for nagios?
12:15 < sgran> I'm carrying around things like that in local packages to work around it, so I'd like to push it to the package before lenny, if possible
12:18 < Ganneff> yes, but for nagios3
12:18 < sgran> you probably want to switch it to log_*_msg from the lsb stuff, but you get the idea
12:18 < Ganneff> file bug
12:18 < sgran> k

--- debian/nagios2-common.nagios2.init.old      2008-04-28 12:05:21.000000000 +0100
+++ debian/nagios2-common.nagios2.init  2008-04-28 12:13:13.000000000 +0100
@@ -146,6 +146,20 @@
 stop () {
     killproc -p "$THEPIDFILE" "$DAEMON"
     ret=$?
+    if [ `pidof nagios2 | wc -l ` -gt 0 ]; then
+        echo -n "Waiting for nagios to die.."
+        cnt=0
+        while [ `pidof nagios2 | wc -l ` -gt 0 ]; do
+            cnt=`expr "$cnt" + 1`
+            if [ "$cnt" -gt 15 ]; then
+                kill -9 `pidof nagios2`
+                break
+            fi
+            sleep 1
+            echo -n "."
+        done
+    fi
+    echo
     if ! check_named_pipe; then
       rm -f $nagiospipe
     fi


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash

-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        sgran at debian.org |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20080428/0393783e/attachment.pgp 


More information about the Pkg-nagios-devel mailing list