Bug 147636
| Summary: | cron fails to run user jobs and gives vague error message | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 4 | Reporter: | Carl Speare <carl> |
| Component: | vixie-cron | Assignee: | Jason Vas Dias <jvdias> |
| Status: | CLOSED ERRATA | QA Contact: | Brock Organ <borgan> |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 4.0 | CC: | herrold, jturner, tao |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | RHSA-2005-361 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2005-10-05 12:34:00 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 156322 | ||
| Attachments: | |||
|
Description
Carl Speare
2005-02-09 23:13:23 UTC
Created attachment 110902 [details]
Wrapper script, which is the entry cron calls.
This is the wrapper.sh script that is called in the cron entry shown in the bug
body.
Created attachment 110903 [details]
The script that wrapper.sh eventually executes to run the user job.
wrapper.sh calls this script (as shown in the cron entry), which is what does
the actual work.
CRON refuses to run any job from a file that contains illegal
characters, so the file I need to see is /var/spool/cron/iom_user
to tell you exectly why it is rejected.
Yes, CRON's error messages on rejecting CRON jobs have always been
singularly unhelpful - there is no easy way to fix this without
fairly major code changes, which would not have been acceptable for
RHEL-4 - lack of error messages is legacy cron behaviour, and I
hope to have an enhanced CRON with good error messages through QA
by RHEL-4-U2 .
CRON considers a file UNSAFE that contains any characters not in this
set will reject any crontab file containing them :
[\n@!:%-.,:alnum::print:]
see man tr(1) for exact meaning of this character class set.
Note that \r (CR, ^M) is NOT a member of this set, so if
/var/spool/cron/iom_user contains MS-DOS style CRLF line endings,
it will be rejected - see man dos2unix(1) .
The full crontab entry, as requested: 32 18 * * 0- 6 /users/iom_user/bea/user_projects/domains/iom_domain/scripts/wrapper .sh /users/iom_user/bea/user_projects/domains/iom_domain/scripts/stopI OM.sh /home/iom_user/iom_order_deploy/ Carl, probably would be best to attach it as an attachment so that Bugzilla doesn't screw up the formatting. As it currently stands, it looks like you have CR at the end of every line, and I don't expect that's really the way it is in your file. Yes, please attach the complete file as an attachment. Alternatively, you could cut and paste the output of this command into the bug: # od -c /var/spool/cron/iom_user [root@zinc-inst ~]# od -c /var/spool/cron/iom_user 0000000 3 2 1 8 * * 0 - 6 / u 0000020 s e r s / i o m _ u s e r / b e 0000040 a / u s e r _ p r o j e c t s / 0000060 d o m a i n s / i o m _ d o m a 0000100 i n / s c r i p t s / w r a p p 0000120 e r . s h / u s e r s / i o m 0000140 _ u s e r / b e a / u s e r _ p 0000160 r o j e c t s / d o m a i n s / 0000200 i o m _ d o m a i n / s c r i p 0000220 t s / s t o p I O M . s h / h 0000240 o m e / i o m _ u s e r / i o m 0000260 _ o r d e r _ d e p l o y / \n 3 0000300 0 6 * * 1 - 5 / h o m 0000320 e / i o m _ u s e r / i o m _ o 0000340 r d e r _ d e p l o y / s c r i 0000360 p t s / s t a r t I O M . s h 0000400 / h o m e / i o m _ u s e r / i 0000420 o m _ o r d e r _ d e p l o y / 0000440 \n 0000441 I've attached the script, since the od came out pretty bad. Created attachment 110950 [details]
the cron file for iom_user
Created attachment 110951 [details]
wrapper.sh - sent directly from the Linux system instead of Windows.
I finally have time to give this bug my full attention .
Yes, Jay - you are right - the problem is that 'safe_delim' does not
contain '_' .
The job is actually executed , as shown by the
crond[24812]: (iom_user) CMD (...)
but its output is lost, because cron rejects the user name as being
an invalid mail recipient user name.
This seems very silly to me - sendmail is able to do its own
validation of user names. I can understand attempting to strip
unallowed binary chars from the output, as this could cause problems
without proper mime encoding, but cron does not attempt to do this .
The short-term workaround is to set 'MAILTO=iomuser'
in iom_user's crontab, and to create an alias of iomuser for
iom_user@localhost in /etc/mail/aliases .
I'm now producing a fix, which will be to to disable mail recipient
name validation unless the 'CRON_VALIDATE_MAILRCPTS' environment
variable is set in /etc/sysconfig/crond, which I will try to get
into RHEL-4-U1 .
This is now fixed in vixie-cron-4.1-22_EL, which is now making its way through QA into RHEL-4-U1 . Meanwhile, you can download it from: http://people.redhat.com/~jvdias/vixie-cron/RHEL-4 Thank you - it works. Better yet, your response time was phenomenal. Thany you again. Adding to the U1 Blocker list. *** Bug 168855 has been marked as a duplicate of this bug. *** An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2005-361.html |