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)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2006-05-09 00:50 UTC by John Hood
Modified: 2022-10-17 12:40 UTC (History)
0 users

See Also:


Attachments
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
running.

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.
How-To-Repeat: 
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.

  --jh
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
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:40:15 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>