From Gerhard.Sittig@gmx.net  Mon Jan 15 12:19:30 2001
Return-Path: <Gerhard.Sittig@gmx.net>
Received: from mail.gmx.net (pop.gmx.net [194.221.183.20])
	by hub.freebsd.org (Postfix) with SMTP id 4876B37B698
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 15 Jan 2001 12:19:29 -0800 (PST)
Received: (qmail 6184 invoked by uid 0); 15 Jan 2001 20:19:27 -0000
Received: from p3ee2166d.dip.t-dialin.net (HELO speedy.gsinet) (62.226.22.109)
  by mail.gmx.net (mp004-rz3) with SMTP; 15 Jan 2001 20:19:27 -0000
Received: (from sittig@localhost)
	by speedy.gsinet (8.8.8/8.8.8) id TAA09309
	for FreeBSD-gnats-submit@freebsd.org; Mon, 15 Jan 2001 19:46:03 +0100
Message-Id: <20010115194603.Y253@speedy.gsinet>
Date: Mon, 15 Jan 2001 19:46:03 +0100
From: Gerhard Sittig <Gerhard.Sittig@gmx.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] etc/rc variables for cron(8)
X-Send-Pr-Version: 3.2

>Number:         24358
>Category:       conf
>Synopsis:       [MFC] [PATCH] etc/rc variables for cron(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 15 12:20:01 PST 2001
>Closed-Date:    Sun Mar 4 22:21:33 PST 2001
>Last-Modified:  Sun Mar 04 22:22:28 PST 2001
>Originator:     Gerhard Sittig
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
in private
>Environment:

any FreeBSD system with cron(8) invocation in /etc/rc

>Description:

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).

>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 ...

>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.

# 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


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.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Sun Jan 21 12:59:04 PST 2001 
State-Changed-Why:  

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.  


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sun Jan 21 12:59:04 PST 2001 
Responsible-Changed-Why:  

I'll handle the MFC. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24358 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dougb 
State-Changed-When: Sun Mar 4 22:21:33 PST 2001 
State-Changed-Why:  

The patch has been MFC'ed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=24358 
>Unformatted:
