Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 154359 - net-analyzer/nagios init.d script reload fails
Summary: net-analyzer/nagios init.d script reload fails
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 172480
  Show dependency tree
 
Reported: 2006-11-07 06:14 UTC by Richard Scott
Modified: 2007-06-06 08:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Scott 2006-11-07 06:14:08 UTC
I've been having problems with nagios checks reporting "No Information Returned From Host Check" when reloading the config via "/etc/init.d/nagios reload"

I have fixed this problem by changing the init.d script to not use the killall command when reloading the config, but to use the kill command instead. 

I now have the following in my init.d script and it works fine.

reload()
{
        checkconfig || return 1
        if [ -f /var/nagios/nagios.lock ]; then
          ebegin "Reloading configuration"
          kill -HUP `cat /var/nagios/nagios.lock` &>/dev/null
          eend $?
        fi
}


I believe that the old way of doing things i.e. using "killall -HUP nagios" was also killing the nagios children doing checks and they were reporting nothing back to the main daemon.

I hope this can be included into the next release :-)
Comment 1 Richard Scott 2006-11-07 06:27:38 UTC
A nicer way of doing this is as follows:

reload()
{
        checkconfig || return 1
        ebegin "Reloading configuration"
        [ -f /var/nagios/nagios.lock ] && kill -HUP `cat /var/nagios/nagios.lock` &>/dev/null
        eend $?
}

This will also display a status output of [!!] when you've tried to reload the config when Nagios isn't running!
Comment 2 Richard Scott 2006-11-07 06:46:09 UTC
ok, this one is confusing me now as its started to fail to reload the config :-(

in /var/nagios/nagios.log we have the following last entry:

[1162910170] Caught SIGHUP, restarting...

It seems that a kill -HUP kills the daemon rather than restarting it.

I've tried executing the daemon form the command line and still the same thing happens:

# /usr/nagios/bin/nagios -d /etc/nagios/nagios.cfg
# kill -HUP `cat /var/nagios/nagios.lock`

when I then look in the process list, there are no nagios items listed :-(
Comment 3 Eldad Zack (RETIRED) gentoo-dev 2006-11-18 03:49:28 UTC
which exact version of nagios are using?
Comment 4 Richard Scott 2006-11-18 04:03:21 UTC
the masked 2.5 version.
Comment 5 Markus Ullmann (RETIRED) gentoo-dev 2007-06-06 08:18:20 UTC
Has become a bit stale, is this still an issue for you? Please reopen if so