mrrl-containers

MRRL version of container scripts
git clone https://ccx.te2000.cz/git/mrrl-containers
Log | Files | Refs

commit 6527552b4aea1f95a38bbbc3b381f9dd13514d4f
parent 672cb4bde017da8ba2a485c7fa7474c7f7ae74b0
Author: Jan Pobříslo <ccx@te2000.cz>
Date:   Thu, 16 Dec 2021 15:54:45 +0000

Set the NS_NO_PID1 environment variable in container_sysroot_run rather than in pidns_run
Diffstat:
Msbin/container_sysroot_run | 1+
Msbin/pidns_run | 6++----
2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/sbin/container_sysroot_run b/sbin/container_sysroot_run @@ -39,6 +39,7 @@ s6-envuidgid ${CONTAINER_USER} # NS_EXTRA="if { mount -o bind,ro /etc/passwd etc/passwd } if { mount -o bind,ro /etc/group etc/group }" emptyenv -c +export NS_NO_PID1 1 pidns_run ns_run data/root /mnt/ns/bin/s6-applyuidgid -U diff --git a/sbin/pidns_run b/sbin/pidns_run @@ -43,13 +43,11 @@ def main(argv): fork2_pid = os.fork() if fork2_pid == 0: # child - env = dict(os.environ) - env['NS_NO_PID1'] = "1" if argv[1][0] == '/': - os.execve(argv[1], argv[1:], env) + os.execv(argv[1], argv[1:]) for d in os.environ['PATH'].split(':'): try: - os.execve(os.path.join(d, argv[1]), argv[1:], env) + os.execv(os.path.join(d, argv[1]), argv[1:]) except FileNotFoundError: continue raise SystemExit(127)