summaryrefslogtreecommitdiffstats
path: root/src/privsep-root.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-08-20 16:28:47 +0100
committerRoy Marples <roy@marples.name>2020-08-20 16:28:47 +0100
commit2d18b2a25e2e95595ff7b643d2a2754540549e3d (patch)
tree736348035fa69ab8f98a919aedd8185728fcd659 /src/privsep-root.c
parent684895a84c40b4484c7e0d7ce555f7154d8e6d22 (diff)
downloaddhcpcd-2d18b2a25e2e95595ff7b643d2a2754540549e3d.tar.xz
privsep: Only the master process accepts signals
The master process dictates when processes should stop, which allows for a clean shutdown when the admin issues `pkill dhcpcd`.
Diffstat (limited to 'src/privsep-root.c')
-rw-r--r--src/privsep-root.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/privsep-root.c b/src/privsep-root.c
index 3e2046ad..1a438b67 100644
--- a/src/privsep-root.c
+++ b/src/privsep-root.c
@@ -693,22 +693,14 @@ ps_root_startcb(void *arg)
}
static void
-ps_root_signalcb(int sig, void *arg)
+ps_root_signalcb(int sig, __unused void *arg)
{
- struct dhcpcd_ctx *ctx = arg;
if (sig == SIGCHLD) {
while (waitpid(-1, NULL, WNOHANG) > 0)
;
return;
}
-
- if (sig != SIGTERM)
- return;
-
- shutdown(ctx->ps_root_fd, SHUT_RDWR);
- shutdown(ctx->ps_data_fd, SHUT_RDWR);
- eloop_exit(ctx->eloop, EXIT_SUCCESS);
}
int (*handle_interface)(void *, int, const char *);