Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 3 product line. The current stable release is 3.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 170803

Summary: cron doesn't run properly
Product: Red Hat Enterprise Linux 3 Reporter: Jason Vas Dias <jvdias>
Component: vixie-cronAssignee: Jason Vas Dias <jvdias>
Status: CLOSED ERRATA QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: benl, nalin
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2005:0117 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-01 17:57:07 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: 105616    
Bug Blocks: 161600    

Description Jason Vas Dias 2005-10-14 16:10:25 UTC
+++ This bug was initially created as a clone of Bug #105616 +++

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701

Description of problem:
There are problems with cron not running jobs and/or not mailing the output to
the user.

If the program only has a little output, it is not mailed. In other
circumstances, the job does not run at all unless one attaches to the process
with strace.

Using nss_ldap seems to exacerbate these issues, but the problem is intermittent
and extremely hard to reproduce in the same way each time.

Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1. define a cron job 'echo this is a test'
2.
3.
    

Actual Results:  output not mailed to user

Expected Results:  output should have been mailed

Additional info:

Here's a patch that fixes the issue:

diff -uNr vixie-cron-3.0.1.orig/do_command.c vixie-cron-3.0.1/do_command.c
--- vixie-cron-3.0.1.orig/do_command.c  2003-09-25 10:57:03.000000000 -0700
+++ vixie-cron-3.0.1/do_command.c       2003-09-25 10:57:37.000000000 -0700
@@ -161,7 +161,7 @@
 
        /* fork again, this time so we can exec the user's command.
         */
-       switch (vfork()) {
+       switch (fork()) {
        case -1:
                log_it("CRON",getpid(),"error","can't vfork");
                exit(ERROR_EXIT);
diff -uNr vixie-cron-3.0.1.orig/popen.c vixie-cron-3.0.1/popen.c
--- vixie-cron-3.0.1.orig/popen.c       2003-09-25 10:57:02.000000000 -0700
+++ vixie-cron-3.0.1/popen.c    2003-09-25 10:57:53.000000000 -0700
@@ -94,7 +94,7 @@
 #endif
 
        iop = NULL;
-       switch(pid = vfork()) {
+       switch(pid = fork()) {
        case -1:                        /* error */
                (void)close(pdes[0]);
                (void)close(pdes[1]);

-- Additional comment from jvdias on 2004-08-04 19:31 EST --
fixed in old vixie-cron-3.? and in latest vixie-cron-4.1-+.

Comment 1 Jason Vas Dias 2005-10-14 16:11:20 UTC
This bug is fixed with vixie-cron-4.1-8_EL3, available from:
  http://people.redhat.com/~jvdias/cron/RHEL-3
and should be considered for inclusion in RHEL-3-U7 .

Comment 4 Jason Vas Dias 2006-05-01 17:57:07 UTC
Fixed with vixie-cron-4.1-10.EL3, currently in RHEL-3-U7 with errata
RHSA-2005:0117.