From: Marcela Mašláňová Date: Mon, 12 Jul 2010 13:58:04 +0000 (+0200) Subject: Syslog output will be used instead of mail X-Git-Tag: cronie1.4.5~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55528ebb1cfa2ba5ef0536fd070eda9a8699cfa0;p=cronie Syslog output will be used instead of mail If sendmail isn't installed, syslog is used. This patch should also solve problem with RPM requirements of sendmail (and which mail should be installed by default). Based on: https://bugzilla.redhat.com/show_bug.cgi?id=472710#c42 --- diff --git a/man/cron.8 b/man/cron.8 index 5b88d0c..6fca8b8 100644 --- a/man/cron.8 +++ b/man/cron.8 @@ -158,6 +158,7 @@ This requirement can be overridden by using the \fB-p\fP option on the crond com If inotify support is in use, changes in the symlinked crontabs are not automatically noticed by the cron daemon. The cron daemon must receive a SIGHUP to reload the crontabs. This is a limitation of inotify API. +The syslog output will be used instead of mail, when sendmail isn't installed. .SH "SEE ALSO" .BR crontab (1), diff --git a/src/cron.c b/src/cron.c index 7b57932..c99c155 100644 --- a/src/cron.c +++ b/src/cron.c @@ -220,6 +220,11 @@ int main(int argc, char *argv[]) { } } + if (access("/usr/sbin/sendmail", X_OK) != 0) { + SyslogOutput=1; + log_it("CRON", pid, "INFO","Syslog will be used instead of sendmail.", errno); + } + pid = getpid(); acquire_daemonlock(0); database.head = NULL;