* Make halt/reboot work again (umount and reboot were no longer in

$PATH).

* Use the login from pam_login instead of shadowutils.

svn path=/nixos/trunk/; revision=7302
This commit is contained in:
Eelco Dolstra 2006-12-11 00:52:36 +00:00
parent c063ea2bfa
commit 578b56d3c6
5 changed files with 26 additions and 25 deletions

View File

@ -10,13 +10,18 @@ echo
# Set the PATH. # Set the PATH.
setPath() {
local dirs="$1"
export PATH=/empty export PATH=/empty
for i in @startPath@; do for i in $dirs; do
PATH=$PATH:$i/bin PATH=$PATH:$i/bin
if test -e $i/sbin; then if test -e $i/sbin; then
PATH=$PATH:$i/sbin PATH=$PATH:$i/sbin
fi fi
done done
}
setPath "@path@"
# Mount special file systems. # Mount special file systems.
@ -98,6 +103,5 @@ udevsettle # wait for udev to finish
# Start Upstart's init. # Start Upstart's init.
export UPSTART_CFG_DIR=/etc/event.d export UPSTART_CFG_DIR=/etc/event.d
export PATH=/empty setPath "@upstartPath@"
for i in @upstartPath@; do PATH=$PATH:$i/bin; done
exec @upstart@/sbin/init -v exec @upstart@/sbin/init -v

View File

@ -10,20 +10,14 @@
upstartPath upstartPath
}: }:
let substituteAll {
src = ./boot-stage-2-init.sh;
startPath = [ isExecutable = true;
inherit kernel upstart readOnlyRoot activateConfiguration upstartPath;
path = [
coreutils coreutils
utillinux utillinux
udev udev
upstart upstart
]; ];
in
substituteAll {
src = ./boot-stage-2-init.sh;
isExecutable = true;
inherit kernel upstart readOnlyRoot activateConfiguration upstartPath;
inherit startPath;
} }

View File

@ -163,7 +163,7 @@ rec {
# Handles the reboot/halt events. # Handles the reboot/halt events.
++ (map ++ (map
(event: makeJob (import ../upstart-jobs/halt.nix { (event: makeJob (import ../upstart-jobs/halt.nix {
inherit (pkgs) bash; inherit (pkgs) bash utillinux;
inherit event; inherit event;
})) }))
["reboot" "halt" "system-halt" "power-off"] ["reboot" "halt" "system-halt" "power-off"]
@ -172,7 +172,7 @@ rec {
# The terminals on ttyX. # The terminals on ttyX.
++ (map ++ (map
(ttyNumber: makeJob (import ../upstart-jobs/mingetty.nix { (ttyNumber: makeJob (import ../upstart-jobs/mingetty.nix {
mingetty = pkgs.mingettyWrapper; inherit (pkgs) mingetty pam_login;
inherit ttyNumber; inherit ttyNumber;
})) }))
[1 2 3 4 5 6] [1 2 3 4 5 6]
@ -326,6 +326,7 @@ rec {
pkgs.findutils pkgs.findutils
pkgs.gnugrep pkgs.gnugrep
pkgs.gnused pkgs.gnused
pkgs.upstart
]; ];
}; };

View File

@ -1,4 +1,4 @@
{bash, event}: {bash, event, utillinux}:
assert event == "reboot" assert event == "reboot"
|| event == "halt" || event == "halt"
@ -17,6 +17,8 @@ script
echo \"<<< SYSTEM SHUTDOWN >>>\" echo \"<<< SYSTEM SHUTDOWN >>>\"
echo \"\" echo \"\"
export PATH=${utillinux}/bin:$PATH
# Do an initial sync just in case. # Do an initial sync just in case.
sync || true sync || true

View File

@ -1,10 +1,10 @@
{mingetty, ttyNumber}: {mingetty, pam_login, ttyNumber}:
{ {
name = "tty" + toString ttyNumber; name = "tty" + toString ttyNumber;
job = " job = "
start on startup start on startup
stop on shutdown stop on shutdown
respawn ${mingetty}/sbin/mingetty --noclear tty${toString ttyNumber} respawn ${mingetty}/sbin/mingetty --loginprog=${pam_login}/bin/login --noclear tty${toString ttyNumber}
"; ";
} }