dbus: mirror legacy runlevel edge cases in Manager1.SetRunlevel

The bus method called sm_runlevel() unconditionally.  In runlevel 0
and 6 that aborts an in-flight shutdown, which INIT_CMD_RUNLVL
refuses with a warning, and during bootstrap it switches immediately
where the legacy path defers via cfglevel to the end of runlevel S.

Port both.  A bad runlevel argument still returns InvalidArgs, where
the legacy protocol acks silently: a typed interface rejects garbage.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-08-16 22:03:37 +02:00
1 parent 8114508bbb
commit b53c7e6879
4 files changed
+29 -23

No files matched your search

+1
View File
@@ -35,6 +35,7 @@ void sm_step (void);
int sm_in_reload (void);
void sm_reload (void);
void sm_runlevel (int newlevel);
void sm_request_runlevel(int lvl);
#endif /* FINIT_SM_H_ */