summaryrefslogtreecommitdiffstats
path: root/src/basic/virt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/virt.c')
-rw-r--r--src/basic/virt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/basic/virt.c b/src/basic/virt.c
index 0970350..2cb3a08 100644
--- a/src/basic/virt.c
+++ b/src/basic/virt.c
@@ -896,6 +896,13 @@ int running_in_chroot(void) {
* mount /proc, so all other programs can assume that if /proc is *not* available, we're in some
* chroot. */
+ r = getenv_bool("SYSTEMD_IN_CHROOT");
+ if (r >= 0)
+ return r > 0;
+ if (r != -ENXIO)
+ log_debug_errno(r, "Failed to parse $SYSTEMD_IN_CHROOT, ignoring: %m");
+
+ /* Deprecated but kept for backwards compatibility. */
if (getenv_bool("SYSTEMD_IGNORE_CHROOT") > 0)
return 0;