summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorHarald van Dijk <harald@gigawatt.nl>2015-02-13 10:20:29 +0000
committerHarald van Dijk <harald@gigawatt.nl>2015-02-13 10:20:29 +0000
commit0fe9d58e4ef739bc361a3d9acb3dd912dad485d2 (patch)
tree8cd94dcf04748a18afb2038036f2eb6e0ba34427 /nixos
parent92f3ec3ba5761d00138a439787948c7a17935c3c (diff)
downloadnixlib-0fe9d58e4ef739bc361a3d9acb3dd912dad485d2.tar
nixlib-0fe9d58e4ef739bc361a3d9acb3dd912dad485d2.tar.gz
nixlib-0fe9d58e4ef739bc361a3d9acb3dd912dad485d2.tar.bz2
nixlib-0fe9d58e4ef739bc361a3d9acb3dd912dad485d2.tar.lz
nixlib-0fe9d58e4ef739bc361a3d9acb3dd912dad485d2.tar.xz
nixlib-0fe9d58e4ef739bc361a3d9acb3dd912dad485d2.tar.zst
nixlib-0fe9d58e4ef739bc361a3d9acb3dd912dad485d2.zip
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.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index 8f185217c3f8..1e173f5ac7af 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