On Tue June 28 2005 09:54, Stephen Cartwright wrote:
> Normally, I would agree with you completely... However the particular
> lock files I am talking about are in /var/lock/subsys (on Red Hat and
> Red Hat based distros). The reason I became curious about this is I
> had to create an init script and while looking at other init scripts I
> realized that many (all the ones I looked at) would "touch" to create
> a file in this directory under their start function and then remove it
> when the stop function is run. In this case the lock seems to be based
> on the process, not a data file. I can't think of any good reason for
> this so it is bothering me... Please help!
>

Check out this article here:

http://www.redhat.com/magazine/008jun05/departments/tips_tricks/

Here's a piece of the article:

"Why do init scripts require lock files?
 by Bradford Hinson

When a service is started through an init script, a file is touched in 
the /var/lock/subsys/ directory with the same name as the init script. When 
the service is stopped, this file is removed. The contents of this file are 
unimportant for the scope of this article, as long as the filename is the 
same as the init script.

This file represents that a service's subsystem is locked, which means the 
service should be running. Since a service may consist of multiple 
executables with different names, finding the process ID (PID) of a single 
executable may not be sufficient to determine the status of the entire 
service itself."

Neil
-- 
Neil Bower
CLUG - http://clug.ca
Registered Linux User # 323470
( http://counter.li.org )

Attachment: pgpnaet4csmt8.pgp
Description: PGP signature

_______________________________________________
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

Reply via email to