Bug 24358

Summary: [MFC] [PATCH] etc/rc variables for cron(8)
Product: Base System Reporter: Gerhard Sittig <Gerhard.Sittig>
Component: confAssignee: Doug Barton <dougb>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   

Description Gerhard Sittig 2001-01-15 20:20:01 UTC
Currently it's neither possible to pass command line options to
the cron daemon nor can one choose which cron executable to run.
Although public discussion proves that there are different
preferences among users as well as a certain wish to escape from
fixed values (while preserving current behaviour as a default).

Fix: Apply the following patch which introduces two new rc.conf
variables named "cron_program" and "cron_flags".  The manpage
wording is copied over from the named section.



virtually yours   82D1 9B9C 01DC 4FB4 D7B4  61BE 3F49 4F77 72DE DA76
Gerhard Sittig   true | mail -s "get gpg key" Gerhard.Sittig@gmx.net
-- 
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.--8LUwfgvUT3KUHG21Ng76XQQM6K9ZrY6EZnJyXYU0swBeuwK4
Content-Type: text/plain; name="file.shar"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.shar"

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	cronvars.diff
#
echo x - cronvars.diff
sed 's/^X//' >cronvars.diff << 'END-of-cronvars.diff'
XIndex: etc/rc
X===================================================================
XRCS file: /CVSREPO/fbsd/src/etc/rc,v
Xretrieving revision 1.240
Xdiff -u -u -r1.240 rc
X--- etc/rc	2000/11/21 04:21:54	1.240
X+++ etc/rc	2001/01/15 19:11:53
X@@ -502,7 +502,7 @@
X [Nn][Oo])
X 	;;
X *)
X-	echo -n ' cron';	cron
X+	echo -n ' cron';	${cron_program:-cron} ${cron_flags}
X 	;;
X esac
X 
XIndex: etc/defaults/rc.conf
X===================================================================
XRCS file: /CVSREPO/fbsd/src/etc/defaults/rc.conf,v
Xretrieving revision 1.83
Xdiff -u -u -r1.83 rc.conf
X--- etc/defaults/rc.conf	2000/10/29 19:59:04	1.83
X+++ etc/defaults/rc.conf	2001/01/15 18:53:03
X@@ -295,6 +295,8 @@
X ##############################################################
X 
X cron_enable="YES"	# Run the periodic job daemon.
X+cron_program="cron"	# Which cron executable to run (if enabled).
X+cron_flags=""		# Which options to pass to the cron daemon.
X lpd_enable="NO"		# Run the line printer daemon.
X lpd_program="/usr/sbin/lpd"	# path to lpd, if you want a different one.
X lpd_flags=""		# Flags to lpd (if enabled).
XIndex: share/man/man5/rc.conf.5
X===================================================================
XRCS file: /CVSREPO/fbsd/src/share/man/man5/rc.conf.5,v
Xretrieving revision 1.84
Xdiff -u -u -r1.84 rc.conf.5
X--- share/man/man5/rc.conf.5	2000/10/28 13:35:30	1.84
X+++ share/man/man5/rc.conf.5	2001/01/15 19:08:44
X@@ -1302,6 +1302,18 @@
X then run the
X .Xr cron 8
X daemon at system boot time.
X+.It Ar cron_program
X+(str) path to
X+.Xr cron 8
X+(default
X+.Pa cron ) .
X+.It Ar cron_flags
X+(str) if
X+.Ar cron_enable
X+is set to
X+.Ar YES ,
X+these are the flags to pass to
X+.Xr cron 8 .
X .It Ar lpd_program
X (str) path to
X .Xr lpd 8
END-of-cronvars.diff
exit
How-To-Repeat: 
Try to tell your FreeBSD system to run a different cron program
or to pass (e.g. some "-x KEY") command line parameters to it
without touching /etc/rc.  It's only possible by setting
"cron_enable=NO" and introducing a new /usr/local/etc/rc.d
script.  Which in turn might ask for another config file ...
Comment 1 Doug Barton freebsd_committer freebsd_triage 2001-01-21 20:59:04 UTC
State Changed
From-To: open->analyzed


This idea has been committed to -current, I'll commit it to RELENG_4 after 
a suitable period. I made a couple changes, most notably specifying the 
full path to cron which I am working on making an rc convention slowly 
but surely. The other change is a whitespace style issue. Whenever you 
place a comment on the same line as working text you want to do: 

foo="bar"<space><tab># Text 

Repeat the tabs as needed, but the reason you put a space there is 
to "absorb" a # character at the beginning of the line without 
breaking up the text alignment. This is a small point, and often 
missed.  


Comment 2 Doug Barton freebsd_committer freebsd_triage 2001-01-21 20:59:04 UTC
Responsible Changed
From-To: freebsd-bugs->dougb


I'll handle the MFC.
Comment 3 Doug Barton freebsd_committer freebsd_triage 2001-03-05 06:21:33 UTC
State Changed
From-To: analyzed->closed


The patch has been MFC'ed.