Add $SYSTEMD_IN_CHROOT to override chroot detection
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 Aug 2024 10:43:05 +0000 (12:43 +0200)
committerMike Yuan <me@yhndnzj.com>
Fri, 16 Aug 2024 08:11:29 +0000 (10:11 +0200)
commit2701c2f67de592fe2565b084cfaec1667767dbaf
treea3b63bc8394abcdffdb5b2d36f83a83883376617
parentf689f57c1e695a466036110500f327d8e910a753
Add $SYSTEMD_IN_CHROOT to override chroot detection

When running unprivileged, checking /proc/1/root doesn't work because
it requires privileges. Instead, let's add an environment variable so
the process that chroot's can tell (systemd) subprocesses whether
they're running in a chroot or not.
docs/ENVIRONMENT.md
src/basic/virt.c
test/test-systemctl-enable.sh
test/units/TEST-74-AUX-UTILS.detect-virt.sh [new file with mode: 0755]