[omd-commits] OMD Git: omd: nagios: Changed init script to kill still running processes during

git version control git at mathias-kettner.de
Wed Apr 3 08:55:18 CEST 2013


Module:   omd
Branch:   master
Commit:   0f6d6556a317d8a023a692af15bd318cd40b4713
URL:      http://omdistro.org/projects/omd/repository/revisions/0f6d6556a317d8a023a692af15bd318cd40b4713

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Apr  3 08:54:56 2013 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Apr  3 08:54:56 2013 +0200

nagios: Changed init script to kill still running processes during
"stop" call after 60 seconds waiting

---

 Changelog                              |    3 ++-
 packages/nagios/skel/etc/init.d/nagios |   13 ++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index afee4d5..8a6afd7 100644
--- a/Changelog
+++ b/Changelog
@@ -24,7 +24,8 @@ This file documents the revision history for the Open Monitoring Distribution
             sys.path set during interpreter initialization
           - Dokuwiki: Now supporting the new multisite cookie format
           - rrdtool: compile and install Python binding
-
+          - nagios: Changed init script to kill still running processes during 
+	            "stop" call after 60 seconds waiting
 
 0.56     Sep 25 2012
           - omd:
diff --git a/packages/nagios/skel/etc/init.d/nagios b/packages/nagios/skel/etc/init.d/nagios
index 81439a6..3ad4952 100755
--- a/packages/nagios/skel/etc/init.d/nagios
+++ b/packages/nagios/skel/etc/init.d/nagios
@@ -128,7 +128,18 @@ nagios_wait_stop() {
         kill $pid
         while kill -0 $pid  >/dev/null 2>&1;  do
             if [ $I = '60' ]; then
-                return 1
+                echo " Nagios still running.. sending SIGKILL"
+                kill -9 $pid
+                I=0
+                while kill -0 $pid  >/dev/null 2>&1;  do
+                    if [ $I = '10' ]; then
+                        return 1
+                    else
+                        echo -n "."
+                        I=$(($I+1))
+                        sleep 1
+                    fi
+                done
             else
                 echo -n "."
                 I=$(($I+1))



More information about the omd-commits mailing list