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

View file

@ -10,20 +10,14 @@
upstartPath
}:
let
startPath = [
substituteAll {
src = ./boot-stage-2-init.sh;
isExecutable = true;
inherit kernel upstart readOnlyRoot activateConfiguration upstartPath;
path = [
coreutils
utillinux
udev
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.
++ (map
(event: makeJob (import ../upstart-jobs/halt.nix {
inherit (pkgs) bash;
inherit (pkgs) bash utillinux;
inherit event;
}))
["reboot" "halt" "system-halt" "power-off"]
@ -172,7 +172,7 @@ rec {
# The terminals on ttyX.
++ (map
(ttyNumber: makeJob (import ../upstart-jobs/mingetty.nix {
mingetty = pkgs.mingettyWrapper;
inherit (pkgs) mingetty pam_login;
inherit ttyNumber;
}))
[1 2 3 4 5 6]
@ -326,6 +326,7 @@ rec {
pkgs.findutils
pkgs.gnugrep
pkgs.gnused
pkgs.upstart
];
};

View file

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

View file

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