systemctl: make "systemctl is-system-running" return "offline" if we are not booted with systemd
This sounds like the better place to expose this than in "systemd-notify --booted". Also document the so far undocumented "unknown" state the command might return. And rearrange the table of states documented to be more like the one for "is-running". Also, don't document the precise exit code of this function, just say errors are reported != 0 or > 0...
This commit is contained in:
@@ -5753,6 +5753,12 @@ static int is_system_running(sd_bus *bus, char **args) {
|
||||
_cleanup_free_ char *state = NULL;
|
||||
int r;
|
||||
|
||||
if (arg_transport == BUS_TRANSPORT_LOCAL && !sd_booted()) {
|
||||
if (!arg_quiet)
|
||||
puts("offline");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
r = sd_bus_get_property_string(
|
||||
bus,
|
||||
"org.freedesktop.systemd1",
|
||||
|
||||
Reference in New Issue
Block a user