summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-28 19:32:07 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-29 15:16:56 +0100
commit040524b4a3e37e4705969004611b7e934552b533 (patch)
treec47959baec2c79bafd0550dfd5567f9973e838c3 /src/systemctl
parenta16f96cd56c6ee251f69fdb2395ad0dcb51abac8 (diff)
systemctl: consider a chroot() environment always offline
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index f5703af241..c7402b5731 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5792,7 +5792,7 @@ static int is_system_running(int argc, char *argv[], void *userdata) {
sd_bus *bus;
int r;
- if (arg_transport == BUS_TRANSPORT_LOCAL && !sd_booted()) {
+ if (running_in_chroot() > 0 || (arg_transport == BUS_TRANSPORT_LOCAL && !sd_booted())) {
if (!arg_quiet)
puts("offline");
return EXIT_FAILURE;
@@ -7642,7 +7642,7 @@ int main(int argc, char*argv[]) {
if (r <= 0)
goto finish;
- if (running_in_chroot() > 0 && arg_action != ACTION_SYSTEMCTL) {
+ if (arg_action != ACTION_SYSTEMCTL && running_in_chroot() > 0) {
log_info("Running in chroot, ignoring request.");
r = 0;
goto finish;