Skip to content

Only start crond if there exist at least one schedule configured#1547

Merged
troglobit merged 2 commits into
mainfrom
only-start-crond-if-schedule
Jun 26, 2026
Merged

Only start crond if there exist at least one schedule configured#1547
troglobit merged 2 commits into
mainfrom
only-start-crond-if-schedule

Conversation

@mattiaswal

Copy link
Copy Markdown
Contributor

Description

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@mattiaswal mattiaswal requested a review from troglobit June 26, 2026 09:32

@troglobit troglobit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice cleanup, only a minor comment!

Comment thread src/confd/src/schedule.c
crond shipped auto-enabled in finit (symlinked into enabled/), so it ran
on every boot.  With no cron jobs /var/spool/cron/crontabs does not exist
and 'crond -f' exits non-zero, which finit then crash-loops until it gives
up ("Service crond keeps crashing, not restarting").

Ship crond available-only and let confd manage it: the schedule plugin
already rebuilds the crontab on every change, so enable + touch crond when
at least one consumer is active and disable it otherwise.  No jobs, no
crond, no crash loop.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
Write the crontab to admin.next on change and promote it on done, drop it
on abort.

Signed-off-by: Mattias Walström <lazzer@gmail.com>
@mattiaswal mattiaswal force-pushed the only-start-crond-if-schedule branch from 4349003 to f866cf1 Compare June 26, 2026 11:34
@mattiaswal mattiaswal requested a review from troglobit June 26, 2026 11:35
@mattiaswal mattiaswal changed the title Only start crond if schedule Only start crond if there exist at least one schedule configured Jun 26, 2026

@troglobit troglobit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@troglobit troglobit merged commit a4e5c27 into main Jun 26, 2026
9 checks passed
@troglobit troglobit deleted the only-start-crond-if-schedule branch June 26, 2026 14:15
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