Author: eelco
Date: 2010-06-08 12:48:16 +0000 (Tue, 08 Jun 2010)
New Revision: 22182

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22182&view=rev

Modified:
   nixos/branches/boot-order/modules/system/boot/stage-2-init.sh
   nixos/branches/boot-order/modules/system/upstart-events/runlevel.nix
   nixos/branches/boot-order/modules/system/upstart-events/shutdown.nix

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


Changes:

Modified: nixos/branches/boot-order/modules/system/boot/stage-2-init.sh
===================================================================
--- nixos/branches/boot-order/modules/system/boot/stage-2-init.sh       
2010-06-08 11:52:16 UTC (rev 22181)
+++ nixos/branches/boot-order/modules/system/boot/stage-2-init.sh       
2010-06-08 12:48:16 UTC (rev 22182)
@@ -134,9 +134,11 @@
 # Run any user-specified commands.
 @shell@ @postBootCommands@
 
+
 # For debugging Upstart.
 #...@shell@ --login < /dev/console > /dev/console 2>&1 &
 
+
 # Start Upstart's init.
 echo "starting Upstart..."
 PATH=/var/run/current-system/upstart/sbin exec init

Modified: nixos/branches/boot-order/modules/system/upstart-events/runlevel.nix
===================================================================
--- nixos/branches/boot-order/modules/system/upstart-events/runlevel.nix        
2010-06-08 11:52:16 UTC (rev 22181)
+++ nixos/branches/boot-order/modules/system/upstart-events/runlevel.nix        
2010-06-08 12:48:16 UTC (rev 22182)
@@ -4,6 +4,15 @@
 
 {
 
+  # 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 =
     { name = "runlevel";
 

Modified: nixos/branches/boot-order/modules/system/upstart-events/shutdown.nix
===================================================================
--- nixos/branches/boot-order/modules/system/upstart-events/shutdown.nix        
2010-06-08 11:52:16 UTC (rev 22181)
+++ nixos/branches/boot-order/modules/system/upstart-events/shutdown.nix        
2010-06-08 12:48:16 UTC (rev 22182)
@@ -58,8 +58,12 @@
               initctl emit -n startup
               exit 0
           fi
-                
-      
+
+
+          # Write a shutdown record to wtmp while /var/log is still writable.
+          reboot --wtmp-only
+
+
           # Set the hardware clock to the system time.
           echo "setting the hardware clock..."
           hwclock --systohc --utc

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to