Skip to content

fix(ns-ha): keep cron jobs disabled on backup across periodic sync#1817

Merged
gsanchietti merged 1 commit into
mainfrom
ha_fix_crontab
Jul 21, 2026
Merged

fix(ns-ha): keep cron jobs disabled on backup across periodic sync#1817
gsanchietti merged 1 commit into
mainfrom
ha_fix_crontab

Conversation

@gsanchietti

@gsanchietti gsanchietti commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

  • HA's periodic (10 min) sync resyncs /etc/crontabs/root from the primary to the backup, which silently re-enables the cron lines update_cron() had already commented out on the NOTIFY_BACKUP transition.
  • Re-run update_cron disable on NOTIFY_SYNC in 600-acme and 900-ns-plug so the disable is reapplied every sync cycle instead of drifting back to enabled between failover and the next sync.

Related issue

#1820

Test plan

  • Verified locally with a stubbed hotplug/crontab harness: NOTIFY_BACKUP disables the tracked cron lines, a simulated resync re-enables them, then NOTIFY_SYNC re-disables them, leaving unrelated cron lines untouched.
  • shellcheck on both files (only pre-existing SC1091/SC3014 notices, consistent with the rest of the file).
  • Manual verification on a live HA pair (backup node keeps /etc/crontabs/root entries commented out across a real sync cycle).

@gsanchietti
gsanchietti force-pushed the ha_fix_crontab branch 2 times, most recently from 354d776 to 54548ac Compare July 21, 2026 06:54
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

@Tbaile Tbaile left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

Looks fine

@gsanchietti
gsanchietti merged commit 3cf3652 into main Jul 21, 2026
3 checks passed
@gsanchietti
gsanchietti deleted the ha_fix_crontab branch July 21, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants