Red Hat Bugzilla – Bug 107863
Add a command line switch to disable the crond daemon from forking.
Last modified: 2007-04-18 12:58:44 EDT
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:
and I have a modified version of the RH9 vixie-cron source rpm with that patch included here:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Actual Results: NA
Expected Results: NA
Probably I'm missing something, but what is this patch trying
to achieve? Why is forking at startup so bad?
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 :)
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.
Now fixed in vixie-cron-4.1-+ (latest version vixie-cron-4.1-7).