On Tue, Feb 12, 2002 at 11:03:09AM -0500, Liam Quin alleged:
> On Tue, Feb 12, 2002 at 03:59:57AM -0800, SI Reasoning wrote:
> > I added killall dhcpcd before I removed dhcpcd.pid and
> > that took care of the stray running dhcpcd's left in
> > memory.
> 
> You might want something like this:
> 
> if test -f /etc/dhcpc/dhcpcd-eth0.pid
> then
>     if kill -0 `cat /etc/dhcpc/dhcpcd-eth0.pid`
>     then
>       # still running
>       echo process `cat /etc/dhcpc/dhcpcd-eth0.pid` already running
>       exit 0
>     else
>       /bin/rm -f /etc/dhcpc/dhcpcd-eth0.pid
>     fi
> fi
> 
> Liam
> 
> -- 
> Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
> Ankh: irc.sorcery.net www.valinor.sorcery.net irc.gnome.org www.advogato.org
> Author, Open Source XML Database Toolkit, Wiley August 2000
> Co-author: The XML Specification Guide, Wiley 1999; Mastering XML, Sybex 2001

If you are going to check the pid, then you should make sure that the possibly
running process is actually dhcpcd...
   diff /proc/`cat /etc/dhcpc/dhcpcd-eth0.pid`/exe /sbin/dhcpcd
or something along that nature.

Reply via email to