Author: eelco
Date: Wed May 16 15:08:44 2012
New Revision: 34138
URL: https://nixos.org/websvn/nix/?rev=34138&sc=1

Log:
* On headless systems, disable the emergency shell and redirect
  mountall output to the standard Upstart job log file
  (/var/log/upstart/mountall).

Modified:
   nixos/trunk/modules/profiles/headless.nix

Modified: nixos/trunk/modules/profiles/headless.nix
==============================================================================
--- nixos/trunk/modules/profiles/headless.nix   Wed May 16 12:00:05 2012        
(r34137)
+++ nixos/trunk/modules/profiles/headless.nix   Wed May 16 15:08:44 2012        
(r34138)
@@ -1,6 +1,10 @@
 # Common configuration for headless machines (e.g., Amazon EC2
 # instances).
 
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
 {
   sound.enable = false;
   boot.vesa = false;
@@ -10,4 +14,15 @@
 
   # Since we can't manually respond to a panic, just reboot.
   boot.kernelParams = [ "panic=1" "stage1panic=1" ];
+
+  # Since we don't have an (interactive) console, disable the
+  # emergency shell (started if mountall fails).
+  jobs."mount-failed".script = mkOverride 50
+    ''
+      ${pkgs.utillinux}/bin/logger -p user.emerg -t mountall "filesystem 
‘$DEVICE’ could not be mounted on ‘$MOUNTPOINT’"
+    '';
+
+  # Likewise, redirect mountall output from the console to the default
+  # Upstart job log file.
+  jobs."mountall".console = mkOverride 50 "";
 }
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to