Init script issue
Russell Scibetti
russell at quadrix.com
Tue Sep 3 20:03:31 CEST 2002
There is a problem with the Nagios init script. A little while back,
Paul (the other person working on Nagios here) noticed that the killproc
function in the init script never ran because there is a killrpoc
function included in the /etc/(rc.d)/init.d/functions that the script
inherits. This was later fixed by changing the name of the function to
killproc_nagios (as it is now in 1.0b5).
However, the same problem exists (at least in RedHat) when you try to do
/etc/init.d/nagios status. status is also an inherited function, so the
status function that is written in the init.d script nevers runs. You
will get a status output, but not the right one. If you are getting a
message like:
nagios (pid 111 222 333.....) is running
then the wrong status function is being called. The real output should
be a one line ps result (ps -p $NagiosPID if you look in the script).
You can fix this one of two ways. The quickest is to change any
reference to "status" to "status_nagios" the same way the killproc
problem was fixed. The other way is to remove or comment out this
section of the script:
if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
This will make sure any function called will run the actual function in
the init script, not the built-in Linux function. There seems to be no
problem with commenting out these lines (I'm running the script just
fine). So unless someone can tell me when these are necessary, you can
remove them and the script will work as it should.
-Russell Scibetti
--
Russell Scibetti
Quadrix Solutions, Inc.
http://www.quadrix.com
(732) 235-2335, ext. 7038
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
More information about the Users
mailing list