Can I rely absolutely on what happens when a process dies.

Johannes Stezenbach js at sig21.net
Tue Dec 7 23:22:31 UTC 2010


On Tue, Dec 07, 2010 at 11:43:53AM +0000, Bob Dunlop wrote:
> > Pid files are not very robust in general.
> 
> You can make you kill script a bit more robust with a simple check.  Get
> the pid from the file and examine "/proc/<pid>/cmdline" which should
> contain the name of the dhcp process as the first null terminated string.
> You can't use "/proc/<pid>/exe" for this because that will just be
> pointing at busybox.  If the name matches you're on to a reasonable bet
> that you are killing the right thing.

start_stop_daemon already implements that, right?

Johannes


More information about the busybox mailing list