From 5a98d6d51444e9213d8780c59a4e48e806c72641 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 18 Mar 2012 01:44:20 +0000 Subject: [PATCH] * 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. svn path=/nixos/trunk/; revision=33221 --- modules/tasks/filesystems.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/tasks/filesystems.nix b/modules/tasks/filesystems.nix index 12219b463ca..b60dd8c27c4 100644 --- a/modules/tasks/filesystems.nix +++ b/modules/tasks/filesystems.nix @@ -201,7 +201,15 @@ in 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 @@ in script = '' - [ -n "$MOUNTPOINT" ] || exit 0 - exec < /dev/console > /dev/console 2>&1 cat <