diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-07-30 14:45:08 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-07-30 14:45:08 +0000 |
commit | 15b588559bf75ebe15bc6ff29f3d591c4f35c0e8 (patch) | |
tree | 89922f9577edfb2a88398a15dbb1ec4aff9e0cca | |
parent | e71e760a9945dffbf2e6238e70768dd52948abe5 (diff) | |
download | busybox-15b588559bf75ebe15bc6ff29f3d591c4f35c0e8.tar.gz |
use SIGTERM to kill off udhcpd, not SIGKILL
-rw-r--r-- | networking/ifupdown.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index f703a5d87..b2ce2a091 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -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")) { |