/var/run/directory/

Chris Adams cmadams at hiwaay.net
Mon Oct 4 14:23:52 UTC 2004


Once upon a time, Jamie Zawinski <jwz at jwz.org> said:
> Maybe this is a dumb question, but what's the point of pid files,
> anyway?  Are they used by anything other than the init.d scripts?
> Why not just use /sbin/pidof instead?

Maybe because it cannot work right?

In a multi-user system, there is nothing that prevents a user from
creating something that calls itself "sshd", "sendmail", "xinetd", etc.
that pidof will see.  Also, if you want to restart a service that forks
children (like sshd and sendmail), you generally don't want to kill all
the children as well.  The only way to know which process is the master
is to look for a PID file.

I opened a Bugzilla requesting enhancement to the init.d functions a
couple of years ago because of this:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=63440

-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.




More information about the fedora-devel-list mailing list