From f86e7810bec53bd0e053fff4a78d5ec729943920 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 14 May 2021 10:34:54 +0200 Subject: [PATCH] sig.c: disable kernel default ctrl-alt-delete handler This fixes a long-standanding issue with finit not controlling the reboot when the user presses ctrl-alt-delete (PC systems). Signed-off-by: Joachim Wiberg --- src/sig.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sig.c b/src/sig.c index 5d5a0659..ad479ffc 100644 --- a/src/sig.c +++ b/src/sig.c @@ -521,7 +521,11 @@ void sig_setup(uev_ctx_t *ctx) erase(SYNC_SHUTDOWN); erase(SYNC_STOPPED); - /* Standard SysV init calls ctrl-alt-delete handler */ + /* + * Standard SysV init calls ctrl-alt-delete handler + * We need to disable kernel default so it sends us SIGINT + */ + reboot(RB_DISABLE_CAD); uev_signal_init(ctx, &sigint_watcher, sigint_cb, NULL, SIGINT); /* BusyBox/SysV init style signals for halt, power-off and reboot. */