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 <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-05-14 10:34:54 +02:00
parent 2018c82ea1
commit f86e7810be
+5 -1
View File
@@ -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. */