From 15b588559bf75ebe15bc6ff29f3d591c4f35c0e8 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 30 Jul 2004 14:45:08 +0000 Subject: [PATCH] use SIGTERM to kill off udhcpd, not SIGKILL --- networking/ifupdown.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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")) {