* Maintain /var/log/wtmp correctly during boot/shutdown.

svn path=/nixos/branches/boot-order/; revision=22182
This commit is contained in:
Eelco Dolstra 2010-06-08 12:48:16 +00:00
parent 7c3ae9e716
commit 3eac003800
3 changed files with 17 additions and 2 deletions

View File

@ -134,9 +134,11 @@ export MODULE_DIR=@kernel@/lib/modules/
# Run any user-specified commands. # Run any user-specified commands.
@shell@ @postBootCommands@ @shell@ @postBootCommands@
# For debugging Upstart. # For debugging Upstart.
#@shell@ --login < /dev/console > /dev/console 2>&1 & #@shell@ --login < /dev/console > /dev/console 2>&1 &
# Start Upstart's init. # Start Upstart's init.
echo "starting Upstart..." echo "starting Upstart..."
PATH=/var/run/current-system/upstart/sbin exec init PATH=/var/run/current-system/upstart/sbin exec init

View File

@ -4,6 +4,15 @@ with pkgs.lib;
{ {
# After booting, go to runlevel 2. (NixOS doesn't really use
# runlevels, but this keeps wtmp happy.)
jobs.boot =
{ name = "boot";
startOn = "startup";
task = true;
script = "telinit 2";
};
jobs.runlevel = jobs.runlevel =
{ name = "runlevel"; { name = "runlevel";

View File

@ -60,6 +60,10 @@ with pkgs.lib;
fi fi
# Write a shutdown record to wtmp while /var/log is still writable.
reboot --wtmp-only
# Set the hardware clock to the system time. # Set the hardware clock to the system time.
echo "setting the hardware clock..." echo "setting the hardware clock..."
hwclock --systohc --utc hwclock --systohc --utc