From 4acc48fc2d9a6f3343a89cd7223bbc6875ac2702 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 18 Mar 2012 18:04:49 +0000 Subject: [PATCH] * Mark tasks such as mount-failed as not to be restarted. svn path=/nixos/trunk/; revision=33237 --- modules/system/activation/switch-to-configuration.sh | 3 ++- modules/tasks/filesystems.nix | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/system/activation/switch-to-configuration.sh b/modules/system/activation/switch-to-configuration.sh index eda1eb288fc8..af2de599d071 100644 --- a/modules/system/activation/switch-to-configuration.sh +++ b/modules/system/activation/switch-to-configuration.sh @@ -121,7 +121,7 @@ done # Start all jobs that are not running but should be. The "should be" # criterion is tricky: the intended semantics is that we end up with -# the same jobs as after a reboot. If it's a task, restart it if it +# the same jobs as after a reboot. If it's a task, start it if it # differs from the previous instance of the same task; if it wasn't # previously run, don't run it. If it's a service, only start it if # it has a "start on" condition. @@ -134,6 +134,7 @@ for job in $(cd $newJobs && ls *.conf); do if [ ! -e "/var/run/upstart-jobs/$job" -o \ "$(readlink -f "$newJobs/$job.conf")" = "$(readlink -f "/var/run/upstart-jobs/$job")" ]; then continue; fi + if ! grep -q "^# RESTART-IF-CHANGED" "$newJobs/$job.conf"; then continue; fi echo "starting task ‘$job’..." start --quiet "$job" || true else diff --git a/modules/tasks/filesystems.nix b/modules/tasks/filesystems.nix index 7808bac12743..383035bba837 100644 --- a/modules/tasks/filesystems.nix +++ b/modules/tasks/filesystems.nix @@ -203,6 +203,7 @@ in jobs."mount-failed" = { task = true; startOn = "mount-failed"; + restartIfChanged = false; script = '' # Don't start the emergency shell if the X server is @@ -225,6 +226,7 @@ in { task = true; startOn = "ip-up"; + restartIfChanged = false; script = '' # Send USR1 to the mountall process. Can't use "pkill @@ -243,6 +245,8 @@ in jobs."emergency-shell" = { task = true; + restartIfChanged = false; + console = "owner"; script =