Bug 97002 - [patch] cron(8) fails quietly if /usr/sbin/sendmail is missing
Summary: [patch] cron(8) fails quietly if /usr/sbin/sendmail is missing
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 6.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2006-05-09 00:50 UTC by John Hood
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:

file.diff (3.29 KB, patch)
2006-05-09 00:50 UTC, John Hood
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hood 2006-05-09 00:50:10 UTC
If cron's job-running child fails to exec /usr/sbin/sendmail and the
cron job writes to stdout, hijinks ensue (thanks for the phrase,
regis!)  The cron job writes on a pipe to a cron process, which
copies it to another pipe to what should be a sendmail.  If this exits
early and the pipe is closed, the cron child process gets killed with
a SIGPIPE.  Since cron delays running sendmail and doing any of this
until it's received something from the cron job, the cron job executes
before any of this happens.  If the cron job writes again on *its*
pipe, it gets a SIGPIPE too, and may fail mysteriously.  There's code
in cron to log mail failures, but the SIGPIPE prevents that code from

Fix: Patch to fix this problem by ignoring SIGPIPE, add logging of failure
to exec /usr/sbin/sendmail, and minor cleanup of logging functions to
get *that* to work.
rm /usr/sbin/sendmail
echo '* * * * * tee /tmp/termcap < /etc/termcap' | crontab -
tail -f /var/log/cron
ls -l /etc/termcap /tmp/termcap
Comment 1 John Hood 2006-05-09 18:16:43 UTC
The last vfork() remaining in do_command.c should be replaced with
fork(), too.  The child is doing way too much for vfork to be
appropriate any more.

Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:39 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped