mirror of
https://github.com/troglobit/finit.git
synced 2026-11-17 19:30:29 +00:00
dbus: honor the shutdown timeout in the reboot family
initctl -t N reboot arms an emergency bypass timer over the legacy socket, but the bus methods took no argument, so the timeout was silently dropped whenever D-Bus was up. Reboot, Halt, and Poweroff now take a timeout in seconds, 0 for none, armed via the same shutdown_bypass() the legacy path uses. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
6 files changed
+55
-24
No files matched your search
@@ -222,16 +222,6 @@ static svc_t *do_find_byc(char *buf, size_t len)
|
||||
return svc_find_by_cond(input);
|
||||
}
|
||||
|
||||
static void bypass_shutdown(void *);
|
||||
struct wq emergency = { .cb = bypass_shutdown };
|
||||
|
||||
static void bypass_shutdown(void *unused)
|
||||
{
|
||||
(void)unused;
|
||||
|
||||
cprintf("TIMEOUT TIMEOUT SHUTTING DOWN NOW!!\n");
|
||||
do_shutdown(halt);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@@ -298,10 +288,7 @@ static int do_reboot(int cmd, int timeout, char *buf, size_t len)
|
||||
return 255;
|
||||
}
|
||||
|
||||
if (timeout > 0) {
|
||||
emergency.delay = timeout * 1000;
|
||||
schedule_work(&emergency);
|
||||
}
|
||||
shutdown_bypass(timeout);
|
||||
|
||||
switch (cmd) {
|
||||
case INIT_CMD_REBOOT:
|
||||
|
||||
Reference in new issue
Block a user