Author: eelco
Date: Sun Mar 18 01:44:20 2012
New Revision: 33221
URL: https://nixos.org/websvn/nix/?rev=33221&sc=1

Log:
* mountall: Don't start the emergency shell if the X server is
  running.  The user won't see it, and the "console owner" stanza
  breaks VT switching and causes the X server to go to 100% CPU time.

Modified:
   nixos/trunk/modules/tasks/filesystems.nix

Modified: nixos/trunk/modules/tasks/filesystems.nix
==============================================================================
--- nixos/trunk/modules/tasks/filesystems.nix   Sat Mar 17 22:25:30 2012        
(r33220)
+++ nixos/trunk/modules/tasks/filesystems.nix   Sun Mar 18 01:44:20 2012        
(r33221)
@@ -201,7 +201,15 @@
         startOn = "mount-failed";
         script =
           ''
-            [ -n "$MOUNTPOINT" ] || exit 0
+            # Don't start the emergency shell if the X server is
+            # running.  The user won't see it, and the "console owner"
+            # stanza breaks VT switching and causes the X server to go
+            # to 100% CPU time.
+            status="$(status xserver || true)"
+            [[ "$status" =~ start/ ]] && exit 0
+
+            stop tty1 || true
+            
             start --no-wait emergency-shell \
               DEVICE="$DEVICE" MOUNTPOINT="$MOUNTPOINT"
           '';
@@ -226,8 +234,6 @@
 
         script =
           ''
-            [ -n "$MOUNTPOINT" ] || exit 0
-
             exec < /dev/console > /dev/console 2>&1
 
             cat <<EOF
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to