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:
Lennart Poettering
2015-09-29 21:55:51 +02:00
parent 16f98462a0
commit 94f099d813
3 changed files with 49 additions and 14 deletions
+6
View File
@@ -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",