[icinga-checkins] icinga.org: icinga-core/test/cgis: install: after daemon stop in init script, retry and then issue a kill -9 on the daemon #1747

git at icinga.org git at icinga.org
Tue Jul 26 18:00:51 CEST 2011


Module: icinga-core
Branch: test/cgis
Commit: 67645ffe6a76ba6a0780d05889ce3e439b4a2b6d
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=67645ffe6a76ba6a0780d05889ce3e439b4a2b6d

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Sat Jul 23 23:18:20 2011 +0200

install: after daemon stop in init script, retry and then issue a kill -9 on the daemon #1747

fixes #1747

---

 Changelog      |    1 +
 daemon-init.in |    9 +++++++--
 rc.ido2db.in   |   11 ++++++++---
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Changelog b/Changelog
index 60d9d27..fe3fc03 100644
--- a/Changelog
+++ b/Changelog
@@ -28,6 +28,7 @@ ENHANCEMENTS
 * install: add configure option to set log dir and cgi log dir and phpapi log dir #1715
 	** e.g. --with-phpapi-log-dir=/var/log/icinga/api --with-log-dir=/var/log/icinga --with-cgi-log-dir=/var/log/icinga/gui
 	** apache user permissions
+* install: after daemon stop in init script, retry and then issue a kill -9 on the daemon #1747
 
 * config: add easy-to-use config examples and scripts for notifications #1697
 	** advanced notify-by-email
diff --git a/daemon-init.in b/daemon-init.in
index bca82f9..d846174 100644
--- a/daemon-init.in
+++ b/daemon-init.in
@@ -88,6 +88,10 @@ killproc_icinga ()
 	fi
 }
 
+kill9proc_icinga()
+{
+	kill -9 $IcingaPID
+}
 
 pid_icinga ()
 {
@@ -167,7 +171,7 @@ case "$1" in
  		# new IcingaRunFile, allowing multiple icinga daemons
  		# to (sooner or later) run - John Sellens
 		#printf 'Waiting for icinga to exit .'
- 		for i in 1 2 3 4 5 6 7 8 9 10 ; do
+ 		for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
  		    if status_icinga > /dev/null; then
  			printf '.'
  			sleep 1
@@ -177,7 +181,8 @@ case "$1" in
  		done
  		if status_icinga > /dev/null; then
  		    echo ''
- 		    echo 'Warning - icinga did not exit in a timely manner. Please try again.'
+ 		    echo 'Warning - icinga did not exit in a timely manner. Sending kill -9'
+		    kill9proc_icinga
  		else
  		    echo 'Stopping icinga done.'
                     rm -f $IcingaRunFile $IcingaLockDir/$IcingaLockFile
diff --git a/rc.ido2db.in b/rc.ido2db.in
index 33d97e1..57ce178 100644
--- a/rc.ido2db.in
+++ b/rc.ido2db.in
@@ -111,11 +111,15 @@ printstatus_ido2db()
 
 killproc_ido2db ()
 {
-
 	kill $2 $Ido2dbPID
 
 }
 
+killproc9_ido2db ()
+{
+        kill -9 $Ido2dbPID
+
+}
 
 pid_ido2db ()
 {
@@ -168,7 +172,7 @@ case "$1" in
  		# happen, and then the exiting ido2db will remove the
  		# new Ido2dbRunFile, allowing multiple ido2db daemons
  		# to (sooner or later) run - John Sellens
- 		for i in 1 2 3 4 5 6 7 8 9 10 ; do
+ 		for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
  		    if status_ido2db > /dev/null; then
  			printf '.'
  			sleep 1
@@ -178,7 +182,8 @@ case "$1" in
  		done
  		if status_ido2db > /dev/null; then
  		    echo ''
- 		    echo "Warning - $servicename did not exit in a timely manner"
+ 		    echo "Warning - $servicename did not exit in a timely manner. Sending kill -9"
+		    kill9proc_ido2db
  		else
  		    echo "done."
 		    rm -f $Ido2dbStatusFile $Ido2dbRunFile $Ido2dbLockDir/$Ido2dbLockFile $Ido2dbCommandFile





More information about the icinga-checkins mailing list