OK, so there's a service (nagios) running on a Debian box that runs just fine, except for one very specific issue that only occurs after the box has been re-started. The issue is easily fixed by re-starting the service by hand. The problem itself is so specific and so confoundingly esoteric that I don't have the time to run it down (a single check out of 500+ comes back with a bug, but only when it's being run by nagios).
Next best thing then, would be to have it re-start the service itself on startup, so no one has to do it by hand every time. So far I've tried to accomplish this by the following:
Adding in "/etc/init.d/nagios restart" to the /etc/rc.local, this does run from looking at the logs, but doesn't fix the issue (must still be done by hand)
Moving the timing for starting nagios to the very end (update-rc.d nagios defaults 99 10)
Went back to the rc.local fix, this time adding in a "sleep 20" line, this does nothing but delay starting the box by 20 seconds.
Anything else I can try/look at?
restart
command to/etc/crontab
? Something like@reboot /etc/init.d/nagios restart
. Just a shot in the dark but it might work.@reboot /etc/init.d/nagios restart > /tmp/cronNagiosLog 2>&1
to the end of the crontab, but no joy. However it did not print anything to the log file I specified? Am I missing something in the crontab? (when I used the same line in the rc.local file it would print to the log path)./tmp
in case crond runs beforetmpfs
is set up.@reboot echo "hello puny human" > /mytemp/rebootSpike 2>&1
. Restart the box, and no files were created in the /mytemp...