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

Bob Dunlop bob.dunlop at xyzzy.org.uk
Tue Dec 7 11:43:53 UTC 2010


> Pid files are not very robust in general.

What he said.  However most daemons will remove their pid files during
**normal termination** and it looks like busybox dhcpc should do this
so it's been terminated abnormally. ie. Killed in some unexpected way.
So it may be worth investigation why that happened.

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.

-- 
        Bob Dunlop


More information about the busybox mailing list