1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 10:25:06 +03:00

systemctl: consider a chroot() environment always offline

This commit is contained in:
Lennart Poettering 2016-01-28 19:32:07 +01:00
parent a16f96cd56
commit 040524b4a3

View File

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