Skip to content

Commit

Permalink
etc/rc1: Support FLUX_INSTANCE_RESTRT
Browse files Browse the repository at this point in the history
Problem: rc1 cancels all jobs when an instance is exited, but that may
not be desireable all of the time, such as some testing scenarios.

Solution: Support an environment variable FLUX_INSTANCE_RESTART to notify
rc1 that we instance restart is occurring and to not cancel jobs upon
instance shutdown.
  • Loading branch information
chu11 committed Nov 18, 2021
1 parent 891fcfa commit 3538d5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion etc/rc1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ if test $RANK -eq 0 -a "${FLUX_SCHED_MODULE}" != "none" \
flux module load ${FLUX_SCHED_MODULE:-sched-simple}
fi

test $RANK -ne 0 || flux admin cleanup-push <<-EOT
test $RANK -ne 0 -o "${FLUX_INSTANCE_RESTART}" = "t" \
|| flux admin cleanup-push <<-EOT
flux queue stop --quiet
flux job cancelall --user=all --quiet -f --states RUN
flux queue idle --quiet
Expand Down

0 comments on commit 3538d5e

Please sign in to comment.