Bug 787833 - crond should complain if the crontab file is not understood
Summary: crond should complain if the crontab file is not understood
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: cronie
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marcela Mašláňová
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-06 21:23 UTC by Need Real Name
Modified: 2012-02-08 07:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-08 07:29:39 UTC
Type: ---


Attachments (Terms of Use)

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.


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