diff options
-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 |