Hi!

Ok, so here is a small patch-for-the-patch. The problem is that I do a 
        kill `cat /var/run/dhcpcd-${DEVICE}.pid`
but I don't check if the running process with the PID we kill is really
dhcpcd. So if you have bad luck, there is a process with this pid, and it
gets killed instead of dhcpcd (with is probably not running at all : this is
the case where you reboot after a crash and the
/var/run/dhcpcd-${DEVICE}.pid is still there, just to bother you).

Instead of :

kill `cat /var/run/dhcpcd-${DEVICE}.pid`

I suggest that we do a :

OLD_PID=`cat /var/run/dhcpcd-${DEVICE}.pid`
kill `ps ax|grep dhcpcd|grep $OLD_PID|cut -b 1-5`

So with this double-grep filter, we are absolutely sure that we kill the
right dhcpcd, and nothing else, because we compare the list of running
processes with the PID in the file /var/run/dhcpcd-${DEVICE}.pid`. It is a
bit longer but it *should* be "bad-luck proof"... =)

Gregus

PS : Is there a problem with the list? I haven't receive any message
today...

Reply via email to