Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronie: prevent from failing without sendmail #32341

Closed
wants to merge 1 commit into from
Closed

cronie: prevent from failing without sendmail #32341

wants to merge 1 commit into from

Conversation

raindev
Copy link
Contributor

@raindev raindev commented Aug 5, 2021

If a job produces output cronie will attempt to send it's output with
sendmail, failing if the command doesn't exist. sendmail failures are
not handled gracefully and will result in remaining cron scripts to not
be executed. The change makes cronie service use syslog so cron jobs
that produce output are working out of the box.

General

Have the results of the proposed changes been tested?

  • I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
  • I generally don't use the affected packages but briefly tested this PR

Does it build and run successfully?

(Please choose at least one native build and, if supported, at least one cross build. More are better.)

  • I built this PR locally for my native architecture, (x86_64, glibc)
  • I built this PR locally for these architectures (if supported. mark crossbuilds):
    • aarch64-musl
    • armv7l
    • armv6l-musl

@ericonr
Copy link
Member

ericonr commented Aug 5, 2021

Missing revbump ;)

@paper42
Copy link
Member

paper42 commented Aug 5, 2021

-s makes cronie log to syslog instead of sendmail even if sendmail is installed, that's probably not what users expect and it would be a breaking change. A proper fix would be to either add sendmail to dependencies or make a patch which fixes this and submit it upstream. but:

Fedora removed sendmail from dependencies in 2010 and they still don't have it:

remove sendmail from requirements. If it's not installed, it will log into (r)syslog.

If a job produces output cronie will attempt to send it's output with
sendmail, failing if the command doesn't exist. sendmail failures are
not handled gracefully and will result in remaining cron scripts to not
be executed. The change makes cronie service use syslog so cron jobs
that produce output are working out of the box.
@raindev
Copy link
Contributor Author

raindev commented Aug 5, 2021

Ah, so cronie does handle missing sendmail gracefully. I wrongly assumed the reason one of the jobs is not run was sendmail but it turned out to be the fact that cronie uses run-parts to start job scripts, which silently ignores scripts with a . in the file name. From run-parts(8):

the names must consist entirely of ASCII upper- and lower-case letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens.

Other files and directories are silently ignored.

@raindev raindev closed this Aug 5, 2021
@raindev raindev deleted the cronie-syslog branch August 5, 2021 18:32
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants