use SIGTERM to kill off udhcpd, not SIGKILL

This commit is contained in:
Eric Andersen 2004-07-30 14:45:08 +00:00
parent e71e760a99
commit 15b588559b

View File

@ -555,8 +555,11 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
int result = 0;
if (execable("/sbin/udhcpc")) {
/* SIGUSR2 forces udhcpc to release the current lease and go inactive,
* and SIGTERM causes udhcpc to exit. Signals are queued and processed
* sequentially so we don't need to sleep */
result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
result += execute("kill -9 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
result += execute("kill -TERM `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec);
} else if (execable("/sbin/pump")) {
result = execute("pump -i %iface% -k", ifd, exec);
} else if (execable("/sbin/dhclient")) {