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 ```
This commit is contained in:
committed by
Luca Boccassi
parent
a663ddc04e
commit
b551a687a4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user