Skip to content

Commit 798aa80

Browse files
committed
nixos-enter: inherit parent PID namespace
Removes the creation of a new PID namespace during nixos-enter so that systemd doesn't detect the child process as being in a "container". In systemd v257, container detection slightly changed to check if the process is a part of the root PID namespace (see https://github.com/systemd/systemd/blob/96c4d9d94d06c6c0a8b68be376505f8d8b5eba2b/src/basic/virt.c#L735). Tooling such as `bootctl` will not perform certain actions if it detects we are in a container, such as not populating EFI variables. This results in broken systemd-boot VM tests.
1 parent 46add74 commit 798aa80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkgs/by-name/ni/nixos-enter/nixos-enter.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ -z "$NIXOS_ENTER_REEXEC" ]; then
1212
if [ "$(id -u)" != 0 ]; then
1313
extraFlags="-r"
1414
fi
15-
exec unshare --fork --mount --uts --mount-proc --pid $extraFlags -- "$0" "$@"
15+
exec unshare --fork --mount --uts --mount-proc $extraFlags -- "$0" "$@"
1616
else
1717
mount --make-rprivate /
1818
fi

0 commit comments

Comments
 (0)