api: acknowledge reboot, halt, and poweroff

Finit carried out a reboot, halt, or poweroff requested over the
initctl socket, but replied with a NACK.  The command printed an
empty line and fell back to signalling PID 1.

The result was never set from the action taken.  Return what
shutdown_now() returns.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-17 11:00:49 +01:00
1 parent 20c422af69
commit 631baab756
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -244,7 +244,7 @@ static int do_reboot(int cmd, int timeout, char *buf, size_t len)
case INIT_CMD_REBOOT:
case INIT_CMD_HALT:
case INIT_CMD_POWEROFF:
shutdown_now(cmd, timeout);
rc = shutdown_now(cmd, timeout);
break;
case INIT_CMD_SUSPEND: