diff --git a/man/systemctl.xml b/man/systemctl.xml
index c1359d1678e..9e9ba5a5b6b 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -1120,9 +1120,9 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
- Printed string
- Meaning
- Return value
+ Name
+ Description
+ Exit Code
@@ -1137,7 +1137,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
linkedMade available through a symlink to the unit file (permanently or just in /run).
- 1
+ > 0linked-runtime
@@ -1145,7 +1145,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
maskedDisabled entirely (permanently or just in /run).
- 1
+ > 0masked-runtime
@@ -1163,7 +1163,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
disabledUnit file is not enabled.
- 1
+ > 0
@@ -1474,22 +1474,25 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
Checks whether the system is operational. This
- returns success when the system is fully up and running,
- meaning not in startup, shutdown or maintenance
- mode. Failure is returned otherwise. In addition, the
+ returns success (exit code 0) when the system is fully up
+ and running, specifically not in startup, shutdown or
+ maintenance mode, and with no failed services. Failure is
+ returned otherwise (exit code non-zero). In addition, the
current state is printed in a short string to standard
output, see table below. Use to
suppress this output.
- Manager Operational States
-
-
-
+ is-system-running output
+
+
+
+ NameDescription
+ Exit Code
@@ -1499,32 +1502,53 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
basic.target is reached
or the maintenance state entered.
+ > 0startingLate bootup, before the job queue
becomes idle for the first time, or one of the
rescue targets are reached.
+ > 0runningThe system is fully
operational.
+ 0degradedThe system is operational but one or more
units failed.
+ > 0maintenanceThe rescue or emergency target is
active.
+ > 0stoppingThe manager is shutting
down.
+ > 0
+
+
+ offline
+ The manager is not
+ running. Specifically, this is the operational
+ state if an incompatible program is running as
+ system manager (PID 1).
+ > 0
+
+
+ unknown
+ The operational state could not be
+ determined, due to lack of resources or another
+ error cause.
+ > 0
diff --git a/man/systemd-notify.xml b/man/systemd-notify.xml
index 06d5ae53199..5832cc67591 100644
--- a/man/systemd-notify.xml
+++ b/man/systemd-notify.xml
@@ -124,7 +124,12 @@
systemd, non-zero otherwise. If this option is passed, no
message is sent. This option is hence unrelated to the other
options. For details about the semantics of this option, see
- sd_booted3.
+ sd_booted3. An
+ alternative way to check for this state is to call
+ systemctl1
+ with the is-system-running command. It will
+ return offline if the system was not booted
+ with systemd.
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 56c7982b8fe..2b9de5d0166 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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",