nagios4 is always stopped incorrectly, causing problems

Bug #1961557 reported by Gerard Kok
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nagios4 (Ubuntu)
New
Undecided
Unassigned

Bug Description

This is a bug in the init script of the nagios4 daemon, /etc/init.d/nagios4, part of the nagios4-common package. I found this bug in version 4.3.4-3 of that package, on Ubuntu server 20.04.3 LTS.

The nagios4 deamon is always stopped by 'kill -9'. Because this happens after a timeout, this is:
- slow
- causes unintended side effects, the main one of which is that the nagios4 retention.dat file is not written on stopping the daemon. This means that on restart of the daemon, host and service states will have reverted back to what they were the last time the retention.dat was written (by default this happens once every hour, and on stopping the daemon).

The cause of the issue is with line 149 of the init script /etc/init.d/nagios4:

killproc -p $THEPIDFILE

This is missing '$NAME', and should read:

killproc -p $THEPIDFILE $NAME

Fixing this allows for correctly stopping the nagios4 daemon.

Note that I found the solution in the Debian bug tracker: https://www.mail-archive.com/search?<email address hidden>&q=subject:%22Bug%23992842%5C%3A+Slow+stop+due+to+killproc+in+%5C%2Fetc%5C%2Finit.d%5C%2Fnagios4%22&o=newest&f=1, so maybe this has been fixed upstream already.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.