But why are the files in /var/lock/subsys on RH and (RH based distros) created given that there is already pid files in /var/run/ which can be used to tell whether or not daemon is already running. The lock files in /var/lock/subsys don't seem to lock a resource, they just seem to indicate that the process is running... but then why not just use the pid file?
Also what happens if the process dies unexpectedly? How does it work with pid files? Is the creation and removal of the pid file done by the OS? Is /var/run checked for old pid files? I used "kill -9" to kill a process and the pid file was still there. Thank you! On 6/27/05, Robert Lewko <[EMAIL PROTECTED]> wrote: > On June 27, 2005 10:47 am, Stephen Cartwright wrote: > > What exactly is the difference between a pid file and a subsystem lock > > file? Why do you need both of them? > > > > Thanks! > > A *.pid file is a file that keeps the PID "process id" and that is to record > which process to send signals to for various reasons, ie. killing the process > (thats not the only reason, but the most common one). > > What a lock file is for is to signal that a particular resource is in use. > Lets say that some program wanted to update /etc/passwd. One way of making > sure that two programs are not updating that file is to create a file > ie. /var/lock/etc/passwd. When the program is finished updating the file it > removes the file in /var/lock. BTW without getting the source I'm not sure > how they handle that. If you are curious get the package called > util-linux.tar.gz from kernel.org. There are several utilities in that > package that have to cope with updating sensitive information like the > passwords. Check it out. > _______________________________________________ clug-talk mailing list [email protected] http://clug.ca/mailman/listinfo/clug-talk_clug.ca Mailing List Guidelines (http://clug.ca/ml_guidelines.php) **Please remove these lines when replying

