Skip to content

Commit 1d129f1

Browse files
chu11mergify[bot]
authored andcommitted
etc/rc1: do not cancel jobs under system instance
Problem: By default in etc/rc1, a script is setup to cancel all jobs when the flux broker is brought down on rank 0. This should not be done when running the system instance. Solution: Check if we are running as the system instance by checking the configuration of systemd.enable via `flux config get`. If we are, do not enable job cancelation.
1 parent 853c7e3 commit 1d129f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

etc/rc1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ if test $RANK -eq 0 -a "${FLUX_SCHED_MODULE}" != "none" \
8989
flux module load ${FLUX_SCHED_MODULE:-sched-simple}
9090
fi
9191

92-
if test $RANK -eq 0 -a -z "${FLUX_DISABLE_JOB_CLEANUP}"; then
92+
if test $RANK -eq 0; then
93+
method=$(flux config get --default=notset exec.method)
94+
if test "${method}" != "systemd" \
95+
-a -z "${FLUX_DISABLE_JOB_CLEANUP}"; then
9396
flux admin cleanup-push <<-EOT
9497
flux queue stop --quiet
9598
flux job cancelall --user=all --quiet -f --states RUN
9699
flux queue idle --quiet
97100
EOT
101+
fi
98102
fi

0 commit comments

Comments
 (0)