From 0fe9d58e4ef739bc361a3d9acb3dd912dad485d2 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Fri, 13 Feb 2015 10:20:29 +0000 Subject: [PATCH] stage-1-init: fix PID 1 shell The PID 1 shell is executed as the last command in a sh invocation. Some shells implicitly use exec for that, but the current busybox ash does not, so the shell gets a wrong PID. Spell out the exec. --- nixos/modules/system/boot/stage-1-init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index 8f185217c3f..1e173f5ac7a 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -36,7 +36,7 @@ EOF read reply if [ -n "$allowShell" -a "$reply" = f ]; then - exec setsid @shell@ -c "@shell@ < /dev/$console >/dev/$console 2>/dev/$console" + exec setsid @shell@ -c "exec @shell@ < /dev/$console >/dev/$console 2>/dev/$console" elif [ -n "$allowShell" -a "$reply" = i ]; then echo "Starting interactive shell..." setsid @shell@ -c "@shell@ < /dev/$console >/dev/$console 2>/dev/$console" || fail