diff options
author | 2013-02-13 19:32:52 +0000 | |
---|---|---|
committer | 2013-02-13 19:32:52 +0000 | |
commit | 6cf9fcfefe5b9435b1bfb575998496be069c218c (patch) | |
tree | 550d7ef2f1afa1267caaed11588176e22ab59f7e | |
parent | - when declaring a static table for userinfo, do not make username part of (diff) | |
download | wireguard-openbsd-6cf9fcfefe5b9435b1bfb575998496be069c218c.tar.xz wireguard-openbsd-6cf9fcfefe5b9435b1bfb575998496be069c218c.zip |
Restore previous behaviour of not cleaning up in response to SIGTERM.
SIGTERM is used to make processes go away during system shutdown and
NFS filesystems may be still be in use when it is received. So removing
routes to the NFS servers is a bad thing.
Problem discovered and fix tested by landry@.
-rw-r--r-- | sbin/dhclient/dhclient.c | 9 | ||||
-rw-r--r-- | sbin/dhclient/dispatch.c | 20 |
2 files changed, 19 insertions, 10 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 3189534825d..41ec7375376 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.226 2013/02/09 23:37:21 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.227 2013/02/13 19:32:52 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -1844,7 +1844,12 @@ fork_privchld(int fd, int fd2) imsg.rdomain = ifi->rdomain; imsg.addr = active_addr; - priv_cleanup(&imsg); + /* + * SIGTERM is used by system at shut down. Be nice and don't cleanup + * routes, possibly preventing NFS from properly shutting down. + */ + if (quit != SIGTERM) + priv_cleanup(&imsg); if (quit == SIGHUP) { warning("Received SIGHUP; restarting."); diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 263dcc5f578..64553aea46a 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.70 2013/01/18 06:05:54 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.71 2013/02/13 19:32:52 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -122,7 +122,7 @@ dispatch(void) another: if (!ifi) { warning("No interfaces available"); - quit = SIGTERM; + quit = SIGQUIT; continue; } @@ -130,7 +130,7 @@ another: warning("Interface %s:" " rdomain changed out from under us", ifi->name); - quit = SIGTERM; + quit = SIGQUIT; continue; } @@ -158,7 +158,7 @@ another: /* Set up the descriptors to be polled. */ if (!ifi || ifi->rfdesc == -1) { warning("No live interface to poll on"); - quit = SIGTERM; + quit = SIGQUIT; continue; } @@ -179,7 +179,7 @@ another: continue; } else { warning("poll: %s", strerror(errno)); - quit = SIGTERM; + quit = SIGQUIT; continue; } } @@ -195,18 +195,22 @@ another: if (fds[2].revents & POLLOUT) { if (msgbuf_write(&unpriv_ibuf->w) == -1) { warning("pipe write error to [priv]"); - quit = SIGTERM; + quit = SIGQUIT; continue; } } if ((fds[2].revents & (POLLIN | POLLHUP))) { warning("lost connection to [priv]"); - quit = SIGTERM; + quit = SIGQUIT; continue; } } - if (client->active) + /* + * SIGTERM is used by system at shut down. Be nice and don't cleanup + * routes, thus possibly preventing NFS from properly shutting down. + */ + if (client->active && quit != SIGTERM) cleanup(client->active); if (quit == SIGHUP) |