From e35433dceb0758e543433612b7c814acf552aa22 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 5 Apr 2020 15:41:45 +0000 Subject: [PATCH] Don't block signals when running hooks. Here ctx->sigset == defsigs == 0x60006003, which blocks SIGTERM by default, so running something simple from a hook, like /etc/rc.d/racoon restart does not work. The script is then stuck waiting for the daemon to die, which it won't since it will never receive the signal, and the hook never terminates. --- external/bsd/dhcpcd/dist/src/script.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external/bsd/dhcpcd/dist/src/script.c b/external/bsd/dhcpcd/dist/src/script.c index bb17d12ca160..cfceb222b9be 100644 --- a/external/bsd/dhcpcd/dist/src/script.c +++ b/external/bsd/dhcpcd/dist/src/script.c @@ -108,7 +108,8 @@ script_exec(const struct dhcpcd_ctx *ctx, char *const *argv, char *const *env) for (i = 0; i < dhcpcd_signals_len; i++) sigaddset(&defsigs, dhcpcd_signals[i]); posix_spawnattr_setsigdefault(&attr, &defsigs); - posix_spawnattr_setsigmask(&attr, &ctx->sigset); + sigemptyset(&defsigs); + posix_spawnattr_setsigmask(&attr, &defsigs); #endif errno = 0; r = posix_spawn(&pid, argv[0], NULL, &attr, argv, env);