[BusyBox] [PATCH] 1.0-rc1 ifupdown fixes

Manousaridis Angelos amanous at inaccessnetworks.com
Mon Jul 26 09:13:40 UTC 2004


Glenn McGrath wrote:
> On Thu, 22 Jul 2004 20:39:53 +0300
> Manousaridis Angelos <amanous at inaccessnetworks.com> wrote:
> 
> 
>>I have a note about this point.
>>Sending a KILL signal is way too violent for stopping the dhcpc.
>>I replaces the kill -9 with
>>kill -USR2 (causes a udhcp release)
>>kill -TERM (causes proper termination of dhcpc, removes pid file)
>>
>>This configuration terminates the session properly:
>>	- sends a dhcp release
>>	- deletes the pid file
>>	- brings the interface down
> 
> 
> Looks good, applied.
> 

After a series of tests, I discovered that this approach (USR2, TERM) 
handles the dhcp release and the removal of the pid file successfully, 
but leaves the interface UP and unconfigured (because of the demote 
command of the dhcp script). I added the following two lines after the 
signals:

execute("while [ -f \"/var/run/udhcpc.%iface%.pid\" ]; do :; done 
2>/dev/null", ifd, exec);
result += execute("ifconfig %iface% down", ifd, exec);

The first one ensures that the dhcpc had enough time to terminate. I am 
not sure if those should be applied, it looks like a dirty hack to me, 
although it works. If someone has a better suggestion I would like to 
hear it.

--
Manousaridis Angelos



More information about the busybox mailing list