[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: /var/run/directory/

Once upon a time, Jamie Zawinski <jwz 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:


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

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]