diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2010-01-07 17:34:18 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2010-01-07 17:34:18 +0000 |
commit | 415d8923e4b88bc37cea7d615ac57dbd3d85cfed (patch) | |
tree | 07df6e7b20d64dd73a8ee2e3376cf105055afbf5 | |
parent | fa089504e46b06cffc9835d9da0b6d6812eb0222 (diff) | |
download | sitesummary-415d8923e4b88bc37cea7d615ac57dbd3d85cfed.tar.gz sitesummary-415d8923e4b88bc37cea7d615ac57dbd3d85cfed.tar.bz2 sitesummary-415d8923e4b88bc37cea7d615ac57dbd3d85cfed.tar.xz |
Change cron job to only reload nagios when the sitesummary generated
nagios configuration is the active one.
-rw-r--r-- | debian/changelog | 7 | ||||
-rwxr-xr-x | debian/sitesummary.cron.daily | 16 |
2 files changed, 20 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 869dc97..4e1f89e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +sitesummary (0.0.52) UNRELEASED; urgency=low + + * Change cron job to only reload nagios when the sitesummary generated + nagios configuration is the active one. + + -- Petter Reinholdtsen <pere@debian.org> Thu, 07 Jan 2010 18:33:30 +0100 + sitesummary (0.0.51) unstable; urgency=low [ Finn-Arne Johansen ] diff --git a/debian/sitesummary.cron.daily b/debian/sitesummary.cron.daily index 62b24c3..a565331 100755 --- a/debian/sitesummary.cron.daily +++ b/debian/sitesummary.cron.daily @@ -96,9 +96,19 @@ fi # Only enable if nagios v3 and sitesummary is installed. if [ -f /etc/init.d/nagios3 ] && [ -x /usr/sbin/sitesummary-nodes ]; then generate_nagios_config - if invoke-rc.d nagios3 status >/dev/null ; then - invoke-rc.d nagios3 reload >/dev/null - fi + # subshell to avoid passing all variables from + # /etc/default/nagios3 to other parts of this script + ( + if [ -r /etc/default/nagios3 ] ; then + . /etc/default/nagios3 + fi + # Only reload nagios if the sitesummary config is the active + # one and nagios3 is currently running. + if [ /etc/nagios3/sitesummary.cfg = "$NAGIOSCFG" ] && \ + invoke-rc.d nagios3 status >/dev/null ; then + invoke-rc.d nagios3 reload >/dev/null + fi + ) fi [ -d $entriesdir ] && remove_old_entries |