Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #1747] after daemon stop in init script, retry and then issue a kill -9 on the daemon #696

Closed
icinga-migration opened this issue Jul 23, 2011 · 4 comments
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/1747

Created by mfriedrich on 2011-07-23 18:25:57 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2011-07-24 09:41:57 +00:00)
Target Version: 1.5
Last Update: 2011-07-24 09:41:56 +00:00 (in Redmine)


like waiting 30 seconds (or the retries and then kill -9 the daemon, making it possible to stop dead daemons.

# Expects $1 to be pid to wait for
kill_then_wait_30_seconds_before_minus_nine()
{
        pid=$1
        kill $pid
        COUNT=30
        while true; do
                kill -0 $pid 2>/dev/null
                if [ $? != 0 ]; then
                        break
                fi
                if [ $COUNT -lt 1 ]; then
                        echo "Process not stopped after 30 seconds - sending kill -9"
                        kill -9 $pid
                        break
                fi
                COUNT=`expr $COUNT - 1`
                sleep 1
        done
}

example from opsview core.

Changesets

2011-07-23 21:18:20 +00:00 by mfriedrich 67645ff

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

fixes #1747
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-07-23 20:43:18 +00:00

  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
  • Priority changed from Normal to Low
  • Target Version set to 1.5

adding this to the default line of "$proc did not exit in a timely manner" but adding "sending kill -9" instead, calling a new function.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-07-23 21:07:50 +00:00

  • Done % changed from 0 to 90

works like expected - on fast reloads (when a db dump happens) or when the daemon really hangs, this is now the demanded solution.

the same has been applied into ido2db.

michi@nbfr:~/coding/icinga/tests$ sudo /etc/init.d/icinga restart
Running configuration check...OK
Stopping icinga: ....................
Warning - icinga did not exit in a timely manner. Sending kill -9
Icinga PID 18593 not running. Removing lockfile.
Starting icinga: Starting icinga done.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-07-23 22:44:42 +00:00

  • Status changed from Assigned to Feedback
  • Done % changed from 90 to 100

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2011-07-24 09:41:57 +00:00

  • Status changed from Feedback to Resolved

Applied in changeset 67645ff.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant