Bug 548843 - RFE: allow user to disable sendmail and send job output to syslog [PATCH]
Summary: RFE: allow user to disable sendmail and send job output to syslog [PATCH]
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cronie
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 472710
TreeView+ depends on / blocked
 
Reported: 2009-12-18 19:28 UTC by Will Woods
Modified: 2010-03-23 16:13 UTC (History)
4 users (show)

Fixed In Version: cronie-1.4.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-23 15:03:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
cronie-1.4.3-syslog-output.patch (5.33 KB, patch)
2009-12-18 19:29 UTC, Will Woods
no flags Details | Diff
cronie-1.4.3-sendmail-off.patch (1.43 KB, patch)
2009-12-18 19:29 UTC, Will Woods
no flags Details | Diff

Description Will Woods 2009-12-18 19:28:28 UTC
As part of the NoMTA feature (https://fedoraproject.org/wiki/Features/NoMTA) we've discovered that cronie is the only package in a default Fedora install that requires sendmail.

cronie normally uses sendmail to mail output from cron jobs to the user who ran them. This requires sendmail to be installed on every system, and leaves the output in local mail queues, which is confusing for a lot of users.

cronie-1.4.3-syslog-output.patch adds a new "-s" flag to crond which makes it send all stdout/stderr from cron jobs to syslog, with the facility/priority of cron.info. The messages are prefixed with the PID of the job, like so:

Dec 18 14:06:01 metroid CROND[4272]: (root) CMD (/root/syslog-test.sh)
Dec 18 14:06:01 metroid CROND[4272]: syslog-test running - rm /var/run/syslog-test to re-run
Dec 18 14:06:01 metroid CROND[4272]: this is multiline output
[etc.]

cronie-1.4.3-sendmail-off.patch allows the string 'off' to be used with the existing -m flag to prevent cron from attempting to send output to sendmail; this avoids error messages like:
Dec 18 14:03:01 metroid CROND[4204]: (CRON) EXEC FAILED (/usr/sbin/sendmail): No such file or directory
Dec 18 14:03:01 metroid CROND[4200]: (root) MAIL (mailed 1319 bytes of output but got status 0x0001#012)

Both options are off by default, so these patches should not change the default behavior of crond.

Comment 1 Will Woods 2009-12-18 19:29:13 UTC
Created attachment 379277 [details]
cronie-1.4.3-syslog-output.patch

Comment 2 Will Woods 2009-12-18 19:29:47 UTC
Created attachment 379278 [details]
cronie-1.4.3-sendmail-off.patch

Comment 3 Marcela Mašláňová 2010-01-05 16:09:32 UTC
These patches looks ok, but there is still problem with 'echoing' text into rsyslog. After every echo is print out incorrect text. This might be a problem of utf-8 in rsyslog.

Jan  5 17:04:01 caladan crond[4268]: (marca) RELOAD (/var/spool/cron/marca)
Jan  5 17:04:01 caladan CROND[4373]: (marca) CMD (touch /tmp/somefile)
Jan  5 17:04:01 caladan CROND[4374]: (marca) CMD (echo test)
Jan  5 17:04:01 caladan CROND[4374]: t�

Comment 4 Marcela Mašláňová 2010-01-08 09:54:31 UTC
Testing srpm: http://mmaslano.fedorapeople.org/test/cronie-1.4.3-3.fc13.src.rpm

rsyslog-4.4.2-3

Reproducer: start crond with -s option and create simple command e.g.
crontab -e
* * * * * echo sometext

The output will be cut as in previous post. This might be a problem of rsyslog, which can't handle it. CC'ing maintainer of rsyslog.

Comment 5 Will Woods 2010-02-15 21:23:06 UTC
I can't reproduce the problem. I did:

crontab -e
* * * * * echo test

Feb 15 16:20:49 kraid crontab[27262]: (wwoods) BEGIN EDIT (wwoods)
Feb 15 16:20:54 kraid crontab[27262]: (wwoods) REPLACE (wwoods)
Feb 15 16:20:54 kraid crontab[27262]: (wwoods) END EDIT (wwoods)
Feb 15 16:21:01 kraid crond[27254]: (wwoods) RELOAD (/var/spool/cron/wwoods)
Feb 15 16:21:01 kraid CROND[27268]: (wwoods) CMD (echo test)
Feb 15 16:21:01 kraid CROND[27268]: test
Feb 15 16:22:01 kraid CROND[27279]: (wwoods) CMD (echo test)
Feb 15 16:22:01 kraid CROND[27279]: test
[etc]

I'm using rsyslog-4.4.2-6.fc13.i686. Maybe it was an rsyslog bug that's fixed now?

Comment 6 Marcela Mašláňová 2010-02-16 08:04:04 UTC
I have still the same problem. I tested on todays rawhide.  Do you have some special setting e.g other than LANG=en_US.UTF-8?

Comment 7 Marcela Mašláňová 2010-02-16 08:20:18 UTC
And updated srpm http://mmaslano.fedorapeople.org/test/cronie-1.4.3-3.fc13.src.rpm

Comment 8 Will Woods 2010-02-16 18:11:58 UTC
LANG=en_US.UTF-8 on my test system; can you reproduce the problem with that locale? What LANG setting is used on the system where you see the problem?

Comment 9 Marcela Mašláňová 2010-02-17 07:22:35 UTC
I have the same LANG.
rpm -q rsyslog
rsyslog-4.4.2-6.fc13.i686

Comment 10 Peter Robinson 2010-03-22 21:52:53 UTC
What is the status of getting this into Fedora-13

Comment 11 Marcela Mašláňová 2010-03-23 08:01:17 UTC
The patch was included in cronie-1.4.4, but I still see problem, which I've mentioned in comment#3.

Comment 12 Will Woods 2010-03-23 14:54:39 UTC
I still can't reproduce the problem, on 4 different systems..

Marcela, what's your system LANG (in /etc/sysconfig/i18n)? Can you try to reproduce the problem on a freshly-installed F13 (alpha) system?

Comment 13 Will Woods 2010-03-23 15:03:21 UTC
On second thought, we should probably close this bug (since the patch requested has been merged - thanks!) and open a new bug for the problem you saw in comment #3.

I've opened bug 576225 for that problem. Thanks again.

Comment 14 Marcela Mašláňová 2010-03-23 16:13:43 UTC
(In reply to comment #12)
> I still can't reproduce the problem, on 4 different systems..
> 
> Marcela, what's your system LANG (in /etc/sysconfig/i18n)? Can you try to
> reproduce the problem on a freshly-installed F13 (alpha) system?    

LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"

I don't have fresh install, I've updated F-14 (current rawhide). I've never have my Czech locales on this test machine ;-)


Note You need to log in before you can comment on or make changes to this bug.