summaryrefslogtreecommitdiffstats
path: root/src/systemctl
diff options
context:
space:
mode:
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>2024-01-15 10:55:31 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-01-15 12:58:38 +0100
commitb551a687a47413a17c4ce61dacee5c0a50520fc4 (patch)
tree6c650f60bdad60c45fc5aced760c988acde0d11f /src/systemctl
parenttest-network: add simple test case for DHCP relay on bridge interface (diff)
downloadsystemd-b551a687a47413a17c4ce61dacee5c0a50520fc4.tar.xz
systemd-b551a687a47413a17c4ce61dacee5c0a50520fc4.zip
systemctl-is-system-running: display "offline" with --image
With the `--image` option, the `running_in_chroot` check is not enough. E.g.: ``` > build/systemctl --image /tmp/20240108-openSUSE.raw is-system-running running ```
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl-is-system-running.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systemctl/systemctl-is-system-running.c b/src/systemctl/systemctl-is-system-running.c
index 6b521c9347..59be6a7a7e 100644
--- a/src/systemctl/systemctl-is-system-running.c
+++ b/src/systemctl/systemctl-is-system-running.c
@@ -29,7 +29,7 @@ int verb_is_system_running(int argc, char *argv[], void *userdata) {
sd_bus *bus;
int r;
- if (running_in_chroot() > 0 || (arg_transport == BUS_TRANSPORT_LOCAL && !sd_booted())) {
+ if (!isempty(arg_root) || running_in_chroot() > 0 || (arg_transport == BUS_TRANSPORT_LOCAL && !sd_booted())) {
if (!arg_quiet)
puts("offline");
return EXIT_FAILURE;