Bug 787833

Summary: crond should complain if the crontab file is not understood
Product: [Fedora] Fedora Reporter: Need Real Name <lsof>
Component: cronieAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: lsof, mmaslano, pertusus, tmraz
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-08 07:29:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Need Real Name 2012-02-06 21:23:50 UTC
Description of problem:
Example problem:

$ tail -n 1 /etc/crontab
0 5 * * * echo date > /tmp/date.txt

This file is invalid: in the system crontab, the sixth field is the user field. Here the user "echo" does not exist, so cronie should log an error.

Version-Release number of selected component (if applicable):
cronie-1.4.8-10.fc16.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1.
2.
3.
  
Actual results:
Silence. No error logged.

Expected results:
Log an error if something is wrong.

Additional info:

Comment 1 Marcela Mašláňová 2012-02-07 08:08:13 UTC
System crontables have errors in log:
Feb  7 09:06:02 localhost /usr/sbin/crond[1095]: (CRON) bad username (/etc/crontab)
If you are using crontab, then you see errors in your crontab immediately.

Comment 2 Need Real Name 2012-02-07 08:20:13 UTC
But I didn't get any error - that's why I reported the bug.

Comment 3 Need Real Name 2012-02-07 08:29:53 UTC
This works:
* * * * * root echo date > /tmp/works.txt

This doesn't:
* * * * * echo date > /tmp/fail.txt

Comment 4 Tomas Mraz 2012-02-07 08:36:55 UTC
Can you look into the /var/log/messages or other log files? It might be possible that interaction with systemd breaks the logging and puts the message in incorrect logfile.

Comment 5 Need Real Name 2012-02-07 21:16:37 UTC
Aha! You're right! cron no longer logs to messages! It has its own log now "/var/log/cron". Thanks!

Comment 6 Marcela Mašláňová 2012-02-08 07:29:39 UTC
Yes, crond is using /var/log/cron for really long time.