* Mark tasks such as mount-failed as not to be restarted.

svn path=/nixos/trunk/; revision=33237
This commit is contained in:
Eelco Dolstra 2012-03-18 18:04:49 +00:00
parent 362d1389d3
commit 4acc48fc2d
2 changed files with 6 additions and 1 deletions

View File

@ -121,7 +121,7 @@ done
# Start all jobs that are not running but should be. The "should be" # 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 # 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 # 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 # previously run, don't run it. If it's a service, only start it if
# it has a "start on" condition. # 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 \ if [ ! -e "/var/run/upstart-jobs/$job" -o \
"$(readlink -f "$newJobs/$job.conf")" = "$(readlink -f "/var/run/upstart-jobs/$job")" ]; "$(readlink -f "$newJobs/$job.conf")" = "$(readlink -f "/var/run/upstart-jobs/$job")" ];
then continue; fi then continue; fi
if ! grep -q "^# RESTART-IF-CHANGED" "$newJobs/$job.conf"; then continue; fi
echo "starting task $job..." echo "starting task $job..."
start --quiet "$job" || true start --quiet "$job" || true
else else

View File

@ -203,6 +203,7 @@ in
jobs."mount-failed" = jobs."mount-failed" =
{ task = true; { task = true;
startOn = "mount-failed"; startOn = "mount-failed";
restartIfChanged = false;
script = script =
'' ''
# Don't start the emergency shell if the X server is # Don't start the emergency shell if the X server is
@ -225,6 +226,7 @@ in
{ {
task = true; task = true;
startOn = "ip-up"; startOn = "ip-up";
restartIfChanged = false;
script = script =
'' ''
# Send USR1 to the mountall process. Can't use "pkill # Send USR1 to the mountall process. Can't use "pkill
@ -243,6 +245,8 @@ in
jobs."emergency-shell" = jobs."emergency-shell" =
{ task = true; { task = true;
restartIfChanged = false;
console = "owner"; console = "owner";
script = script =