Environmental leakage
17 Mar 2009Just spent an hour trying to debug why a simple Nagios check script was not working. It basically ran lynx -dump | grep desired string, but for some reason was utterly failing to work.
Eventually I thought to get the script to print out its
environment. It turned out that my own environment variables had
leaked to the nagios program itself; as a result, lynx was trying (and
failing) to open /home/hugh
. /etc/init.d/nagios
did not (properly?
perhaps) clean the environment as I assumed it had. I changed my
Makefile to run env -i /etc/init.d/nagios restart
, and now it works
just fine.
(Incidentally, I love Makefiles as a way of scripting stuff you run over and over and over again. Yeah, they're clumsy and I'm not doing anything I couldn't do with a simple script -- but it's a timesaver to just run "make" and be done with it.)
Add a comment:
Name and email required; email is not displayed.
Related Posts
QRP weekend 08 Oct 2018
Open Source Cubesat Workshop 2018 03 Oct 2018
mpd crash? try removing files in /var/lib/mpd/ 11 Aug 2018