Bug 105616 - cron doesn't run properly
Summary: cron doesn't run properly
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: vixie-cron   
(Show other bugs)
Version: 9
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact: Brock Organ
Depends On:
Blocks: 170803
TreeView+ depends on / blocked
Reported: 2003-09-25 23:17 UTC by Ian Macdonald
Modified: 2007-04-18 16:57 UTC (History)
0 users

Fixed In Version: vixie-cron-4.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-04 23:31:05 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Ian Macdonald 2003-09-25 23:17:45 UTC
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:

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

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");
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 @@
        iop = NULL;
-       switch(pid = vfork()) {
+       switch(pid = fork()) {
        case -1:                        /* error */

Comment 1 Jason Vas Dias 2004-08-04 23:31:05 UTC
fixed in old vixie-cron-3.? and in latest vixie-cron-4.1-+.

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