From 4c5da3dbde37cd2f8c1f8669d0b0339d8fa9e8cc Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 15 Jan 2024 10:55:31 +0100
Subject: [PATCH 0152/1160] 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
```

(cherry picked from commit b551a687a47413a17c4ce61dacee5c0a50520fc4)
---
 src/systemctl/systemctl-is-system-running.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.33.0