Bug 107863 - Add a command line switch to disable the crond daemon from forking.
Summary: Add a command line switch to disable the crond daemon from forking.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: vixie-cron
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact: Brock Organ
URL: http://caspian.dotconf.net/menu/Softw...
Whiteboard:
Depends On:
Blocks: 170800
TreeView+ depends on / blocked
 
Reported: 2003-10-23 20:41 UTC by Brandon Zehm
Modified: 2007-04-18 16:58 UTC (History)
0 users

Fixed In Version: vixie-cron-4.1
Clone Of:
Environment:
Last Closed: 2004-08-04 23:12:19 UTC
Embargoed:


Attachments (Terms of Use)

Description Brandon Zehm 2003-10-23 20:41:48 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)

Description of problem:
This is a request for a command line switch to disable the crond daemon from forking into the background on startup.  This feature would be very useful when running crond from init or from DJB's daemontools.

I have patched the current version of vixie-cron that is shipped with Redhat 9.0 and added a -n (no fork) option.  It is a very simple (9 line) patch.

That patch is available here:
http://caspian.dotconf.net/menu/Software/Misc/vixie-cron-3.0.1-nofork.patch

and I have a modified version of the RH9 vixie-cron source rpm with that patch included here:
http://caspian.dotconf.net/menu/Software/Misc/vixie-cron-3.0.1-75.src.rpm


Version-Release number of selected component (if applicable):
vixie-cron-3.0.1-74

How reproducible:
Always

Steps to Reproduce:
1. N/A
2.
3.
    

Actual Results:  NA

Expected Results:  NA

Additional info:

NA

Comment 1 Jens Petersen 2003-10-30 01:30:56 UTC
Probably I'm missing something, but what is this patch trying
to achieve?  Why is forking at startup so bad?

Comment 2 Brandon Zehm 2003-10-30 06:48:03 UTC
No problem, let me try to explain where I'm coming from.

Forking at startup isn't really that bad.  In fact most all daemons
should and do.  However, many daemons also have a command line option
to disable forking at startup.  Good examples of this are sysklogd,
sshd, and ntpd (and many others).  This functionality is useful for
running the daemon from inittab, or from DJB's daemon tools, or from a
bash "while true" loop.  Running daemons from any of these sort of
"failsafe" configurations usually requires that the daemon not fork at
startup, so that if it does die for some reason the loop can
immediatly restart the daemon.

I manage an enterprise Linux environment for a fortune 50 company, and
have decided to deploy DJB's daemon-tools to keep mission critical
services running.  Every daemon that we needed to run via daemon-tools
has a command line switch (or configuration file option) to disable
forking at startup, except vixie-cron.  In order to keep all our
daemons running from daemon-tools I added the -n command line option
to it to disable forking.  It would be nice if Redhat would
incorporate this non-intrusive patch so that I don't have to patch and
recompile vixie-cron every time I upgrade our servers :)

Brandon Zehm

Comment 3 Jens Petersen 2004-06-30 16:13:33 UTC
Ok, cron 4.1 has a -n option to run in the foreground.
It may be a little while though before we're ready to
upgrade to 4.1.

Comment 4 Jason Vas Dias 2004-08-04 23:12:19 UTC
Now fixed in vixie-cron-4.1-+ (latest version vixie-cron-4.1-7).


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