fix(ns-ha): keep cron jobs disabled on backup across periodic sync#1817
Merged
Conversation
gsanchietti
force-pushed
the
ha_fix_crontab
branch
2 times, most recently
from
July 21, 2026 06:54
354d776 to
54548ac
Compare
The 10-minute HA sync resyncs /etc/crontabs/root from the primary, which silently re-enables the cron lines that update_cron() had already commented out on the NOTIFY_BACKUP transition. Re-run the disable step on every NOTIFY_SYNC so it stays applied instead of reverting between failover and the next sync cycle. Also disable new scripts that have been added during the time. Assisted-by: Claude Code:claude-sonnet-5
gsanchietti
force-pushed
the
ha_fix_crontab
branch
from
July 21, 2026 07:26
54548ac to
990693c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/etc/crontabs/rootfrom the primary to the backup, which silently re-enables the cron linesupdate_cron()had already commented out on theNOTIFY_BACKUPtransition.update_cron disableonNOTIFY_SYNCin600-acmeand900-ns-plugso the disable is reapplied every sync cycle instead of drifting back to enabled between failover and the next sync.Related issue
#1820
Test plan
NOTIFY_BACKUPdisables the tracked cron lines, a simulated resync re-enables them, thenNOTIFY_SYNCre-disables them, leaving unrelated cron lines untouched.shellcheckon both files (only pre-existingSC1091/SC3014notices, consistent with the rest of the file)./etc/crontabs/rootentries commented out across a real sync cycle).