SV: /var/lock/subsys reference

Kurt Inge Smådal kurt at emsp.no
Wed Oct 30 08:20:55 CET 2002


The nagios file in /var/lock/subsys is created when you do nagios start
and its removed when you do nagios stop

The reason for the /var/lock/subsys/nagios file is that on 
Redhat (and maybe other systems) there is a killall script that shutdown  all services running when you take a reboot/shutdown on the system.
This is done by reading the /var/lock/subsys directory and run the stop script for all servicenames which are found there.

It's done something like this (in a simple way):

for service in /var/lock/subsys/*; do
	/etc/rc.d/init.d/$service stop
done


So if you are running an OS with no /var/lock/subsys then there is probably another way to kill all services on shutdown.

> -----Opprinnelig melding-----
> Fra: Russell Scibetti [mailto:russell at quadrix.com]
> Sendt: 29. oktober 2002 21:48
> Til: nagios-users at lists.sourceforge.net; nagios-
> devel at lists.sourceforge.net
> Emne: [Nagios-users] /var/lock/subsys reference
> 
> I've noticed that the init script that comes with Nagios makes reference
> to a nagios file in the /var/lock/subsys directory when you try to stop
> Nagios.  It tries removing this file.
> 
> Well, I'm trying to figure out is when/how this file is even created?
>  The only references I can see to it are in the functions file and the
> init script itself.
> 
> Also, two more question about this.  What if you aren't running on
> Linux, on an OS that doesn't use /var/lock/subsys?  That reference
> definitely seems hardcoded in the init daemon-init.in file.  And what
> happens when you are running multiple instances of Nagios on 1 box.
> 
> I know Nagios uses the nagios.lock file for PID storage, and on the
> Linux boxes I have running Nagios, the /var/lock/subsys/nagios file is
> empty.  Is this necessary?  I don't understand what function this
> exactly serves.  Any help with this would be appreciated as I am trying
> to rewrite the init script to be more OS generic (some parts of it don't
> work on Solaris).  Thanks.
> 
> -Russell Scibetti
> 
> --
> Russell Scibetti
> Quadrix Solutions, Inc.
> http://www.quadrix.com
> (732) 235-2335, ext. 7038
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list