Pause optional ai-rem update jobs during backup snapshots
This commit is contained in:
1 parent
be48ee85ef
commit
68c21db454
4 files changed
+39
-2
No files matched your search
@@ -225,13 +225,22 @@ if [[ $UP_WORKER == false ]]; then
|
||||
remaining=()
|
||||
for unit in "${QUIESCE_SERVICES[@]}"; do
|
||||
case ${unit%.service} in
|
||||
ai-rem|ai-rem-healthcheck|ai-rem-backup|ai-rem-prune|ai-rem-healthcheck.timer|ai-rem-backup.timer|ai-rem-prune.timer) ;;
|
||||
ai-rem|ai-rem-healthcheck|ai-rem-backup|ai-rem-prune|ai-rem-managed-update|ai-rem-healthcheck.timer|ai-rem-backup.timer|ai-rem-prune.timer|ai-rem-managed-update.timer) ;;
|
||||
*) remaining+=("$unit") ;;
|
||||
esac
|
||||
done
|
||||
for unit in "${ai_rem_units[@]}"; do
|
||||
[[ $(systemctl show "$unit" --property=LoadState --value) == loaded ]] || die "Missing ai-rem unit: $unit"
|
||||
done
|
||||
# Older hosts have no managed updater yet. When installed, stop its timer
|
||||
# and job before taking the database snapshot; resume them after ai-rem.
|
||||
optional_ai_rem_units=()
|
||||
for unit in ai-rem-managed-update.timer ai-rem-managed-update.service; do
|
||||
if [[ $(systemctl show "$unit" --property=LoadState --value) == loaded ]]; then
|
||||
optional_ai_rem_units+=("$unit")
|
||||
fi
|
||||
done
|
||||
ai_rem_units=("${optional_ai_rem_units[@]}" "${ai_rem_units[@]}")
|
||||
QUIESCE_SERVICES=("${ai_rem_units[@]}" "${remaining[@]}")
|
||||
echo 'ai-rem included: /srv/ai-rem and /etc/ai-rem; container and maintenance jobs stopped during snapshot'
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user