From owner-freebsd-rc@FreeBSD.ORG Sun Jan 8 23:12:26 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id DCA541065672; Sun, 8 Jan 2012 23:12:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 594E214F164; Sun, 8 Jan 2012 23:12:25 +0000 (UTC) Message-ID: <4F0A22D8.8090206@FreeBSD.org> Date: Sun, 08 Jan 2012 15:12:24 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Hiroki Sato References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> In-Reply-To: <20120108.081216.1547061187942402256.hrs@allbsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------000209040905030802020303" Cc: freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 23:12:26 -0000 This is a multi-part message in MIME format. --------------000209040905030802020303 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/07/2012 15:12, Hiroki Sato wrote: > I am always wondering if defining $rcvar as "${name}_enable" at the > end of load_rc_config() when $rcvar is undefined is bad idea. > > Is there any problem with removing rcvar=... in individual rc.d > scripts except for non-standard ones (empty or different from > ${name}_enable)? It looks simpler than writing the same line > "rcvar=${name}_enable" many times in various places. This sounds like a great idea in theory, but in practice it doesn't work out, for 2 reasons. First, we have a lot of scripts in the base (about 1/3) that rely on the lack of any rcvar meaning that it gets run unconditionally. In order to provide backwards compatibility we'd have to add code to enable things by default that were previously unset. That's not hard to do, but .... The other reason is that for ports, the scripts generally look like this: load_rc_config foo : ${foo_enable:=NO} See the problem? There are ways around both of these issues, but they involve much more dramatic changes that I don't think buy us much, if anything. There are already a large'ish number of things that are repeated in each rc.d script, so leaving this one in doesn't hurt anything. Whereas removing the forks caused by calling set_rcvar actually gains us a shorter boot time.* Attached is a patch that does what I suggested a long time ago, removes set_rcvar() entirely and assigns each rcvar statically. I'll commit this in a few days if no one objects. (Note, it can't be committed yet because the scripts in ports that call set_rcvar() have to be modified first.) Doug * Yes, I know that we're only gaining a second, maybe two. But each time we do something to improve the boot time the cumulative effect is what we're after. -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------000209040905030802020303 Content-Type: text/plain; name="rcd-no-set_rcvar.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rcd-no-set_rcvar.diff" Index: rc.d/nscd =================================================================== --- rc.d/nscd (revision 229825) +++ rc.d/nscd (working copy) @@ -19,7 +19,7 @@ . /etc/rc.subr name="nscd" -rcvar=`set_rcvar` +rcvar="nscd_enable" command=/usr/sbin/nscd extra_commands="flush" Index: rc.d/mountd =================================================================== --- rc.d/mountd (revision 229825) +++ rc.d/mountd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="mountd" -rcvar=`set_rcvar` +rcvar="mountd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/exports" Index: rc.d/ntpdate =================================================================== --- rc.d/ntpdate (revision 229825) +++ rc.d/ntpdate (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ntpdate" -rcvar=`set_rcvar` +rcvar="ntpdate_enable" stop_cmd=":" start_cmd="ntpdate_start" Index: rc.d/powerd =================================================================== --- rc.d/powerd (revision 229825) +++ rc.d/powerd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="powerd" -rcvar=`set_rcvar` +rcvar="powerd_enable" command="/usr/sbin/${name}" stop_postcmd=powerd_poststop Index: rc.d/rtsold =================================================================== --- rc.d/rtsold (revision 229825) +++ rc.d/rtsold (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rtsold" -rcvar=`set_rcvar` +rcvar="rtsold_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" start_postcmd="rtsold_poststart" Index: rc.d/ipnat =================================================================== --- rc.d/ipnat (revision 229825) +++ rc.d/ipnat (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ipnat" -rcvar=`set_rcvar` +rcvar="ipnat_enable" load_rc_config $name start_cmd="ipnat_start" stop_cmd="${ipnat_program} -F -C" Index: rc.d/lpd =================================================================== --- rc.d/lpd (revision 229825) +++ rc.d/lpd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="lpd" -rcvar=`set_rcvar` +rcvar="lpd_enable" command="/usr/sbin/${name}" required_files="/etc/printcap" start_precmd="chkprintcap" Index: rc.d/nfscbd =================================================================== --- rc.d/nfscbd (revision 229825) +++ rc.d/nfscbd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="nfscbd" -rcvar=`set_rcvar` +rcvar="nfscbd_enable" command="/usr/sbin/${name}" sig_stop="USR1" Index: rc.d/ip6addrctl =================================================================== --- rc.d/ip6addrctl (revision 229825) +++ rc.d/ip6addrctl (working copy) @@ -12,7 +12,7 @@ . /etc/network.subr name="ip6addrctl" -rcvar=`set_rcvar` +rcvar="ip6addrctl_enable" start_cmd="ip6addrctl_start" stop_cmd="ip6addrctl_stop" extra_commands="status prefer_ipv6 prefer_ipv4" Index: rc.d/dmesg =================================================================== --- rc.d/dmesg (revision 229825) +++ rc.d/dmesg (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="dmesg" -rcvar=`set_rcvar` +rcvar="dmesg_enable" dmesg_file="/var/run/dmesg.boot" start_cmd="do_dmesg" stop_cmd=":" Index: rc.d/sshd =================================================================== --- rc.d/sshd (revision 229825) +++ rc.d/sshd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="sshd" -rcvar=`set_rcvar` +rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" Index: rc.d/watchdogd =================================================================== --- rc.d/watchdogd (revision 229825) +++ rc.d/watchdogd (working copy) @@ -34,7 +34,7 @@ . /etc/rc.subr name="watchdogd" -rcvar="`set_rcvar`" +rcvar="watchdogd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Index: rc.d/netwait =================================================================== --- rc.d/netwait (revision 229825) +++ rc.d/netwait (working copy) @@ -14,7 +14,7 @@ . /etc/rc.subr name="netwait" -rcvar=`set_rcvar` +rcvar="netwait_enable" start_cmd="${name}_start" stop_cmd=":" Index: rc.d/gptboot =================================================================== --- rc.d/gptboot (revision 229825) +++ rc.d/gptboot (working copy) @@ -34,7 +34,7 @@ . /etc/rc.subr name="gptboot" -rcvar=`set_rcvar` +rcvar="gptboot_enable" start_cmd="gptboot_report" gptboot_report() Index: rc.d/rpcbind =================================================================== --- rc.d/rpcbind (revision 229825) +++ rc.d/rpcbind (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="rpcbind" -rcvar=`set_rcvar` +rcvar="rpcbind_enable" command="/usr/sbin/${name}" stop_postcmd='/bin/rm -f /var/run/rpcbind.*' Index: rc.d/ddb =================================================================== --- rc.d/ddb (revision 229825) +++ rc.d/ddb (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ddb" -rcvar=`set_rcvar` +rcvar="ddb_enable" command="/sbin/${name}" start_precmd="ddb_prestart" stop_cmd=":" Index: rc.d/sendmail =================================================================== --- rc.d/sendmail (revision 229825) +++ rc.d/sendmail (working copy) @@ -15,7 +15,7 @@ . /etc/rc.subr name="sendmail" -rcvar=`set_rcvar` +rcvar="sendmail_enable" required_files="/etc/mail/${name}.cf" start_precmd="sendmail_precmd" @@ -79,14 +79,14 @@ if checkyesno sendmail_submit_enable; then name="sendmail_submit" - rcvar=`set_rcvar` + rcvar="sendmail_submit_enable" start_cmd="${command} ${sendmail_submit_flags}" run_rc_command "$1" fi if checkyesno sendmail_outbound_enable; then name="sendmail_outbound" - rcvar=`set_rcvar` + rcvar="sendmail_outbound_enable" start_cmd="${command} ${sendmail_outbound_flags}" run_rc_command "$1" fi Index: rc.d/pfsync =================================================================== --- rc.d/pfsync (revision 229825) +++ rc.d/pfsync (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="pfsync" -rcvar=`set_rcvar` +rcvar="pfsync_enable" start_precmd="pfsync_prestart" start_cmd="pfsync_start" stop_cmd="pfsync_stop" Index: rc.d/bootparams =================================================================== --- rc.d/bootparams (revision 229825) +++ rc.d/bootparams (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="bootparamd" -rcvar=`set_rcvar` +rcvar="bootparamd_enable" required_files="/etc/bootparams" command="/usr/sbin/${name}" Index: rc.d/jail =================================================================== --- rc.d/jail (revision 229825) +++ rc.d/jail (working copy) @@ -17,7 +17,7 @@ . /etc/rc.subr name="jail" -rcvar=`set_rcvar` +rcvar="jail_enable" start_precmd="jail_prestart" start_cmd="jail_start" Index: rc.d/quota =================================================================== --- rc.d/quota (revision 229825) +++ rc.d/quota (working copy) @@ -13,7 +13,7 @@ . /etc/rc.subr name="quota" -rcvar=`set_rcvar` +rcvar="quota_enable" load_rc_config $name start_cmd="quota_start" stop_cmd="/usr/sbin/quotaoff ${quotaoff_flags}" Index: rc.d/nfsd =================================================================== --- rc.d/nfsd (revision 229825) +++ rc.d/nfsd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="nfsd" -rcvar=`set_rcvar nfs_server` +rcvar="nfs_server_enable" command="/usr/sbin/${name}" load_rc_config $name Index: rc.d/routed =================================================================== --- rc.d/routed (revision 229825) +++ rc.d/routed (working copy) @@ -10,8 +10,8 @@ . /etc/rc.subr name="routed" +rcvar="routed_enable" desc="network RIP and router discovery routing daemon" -rcvar=`set_rcvar` set_rcvar_obsolete router_enable routed_enable set_rcvar_obsolete router routed_program Index: rc.d/ubthidhci =================================================================== --- rc.d/ubthidhci (revision 229825) +++ rc.d/ubthidhci (working copy) @@ -11,8 +11,8 @@ . /etc/rc.subr name="ubthidhci" +rcvar="ubthidhci_enable" command="/usr/sbin/usbconfig" -rcvar=`set_rcvar` start_precmd="ubthidhci_prestart" ubthidhci_prestart() Index: rc.d/pf =================================================================== --- rc.d/pf (revision 229825) +++ rc.d/pf (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="pf" -rcvar=`set_rcvar` +rcvar="pf_enable" load_rc_config $name start_cmd="pf_start" stop_cmd="pf_stop" Index: rc.d/ftp-proxy =================================================================== --- rc.d/ftp-proxy (revision 229825) +++ rc.d/ftp-proxy (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ftpproxy" -rcvar=`set_rcvar` +rcvar="ftpproxy_enable" command="/usr/sbin/ftp-proxy" load_rc_config $name Index: rc.d/pppoed =================================================================== --- rc.d/pppoed (revision 229825) +++ rc.d/pppoed (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="pppoed" -rcvar="`set_rcvar`" +rcvar="pppoed_enable" start_cmd="pppoed_start" # XXX stop_cmd will not be straightforward stop_cmd=":" Index: rc.d/rfcomm_pppd_server =================================================================== --- rc.d/rfcomm_pppd_server (revision 229825) +++ rc.d/rfcomm_pppd_server (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rfcomm_pppd_server" -rcvar=`set_rcvar` +rcvar="rfcomm_pppd_server_enable" command="/usr/sbin/rfcomm_pppd" start_cmd="rfcomm_pppd_server_start" stop_cmd="rfcomm_pppd_server_stop" Index: rc.d/ftpd =================================================================== --- rc.d/ftpd (revision 229825) +++ rc.d/ftpd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ftpd" -rcvar=`set_rcvar` +rcvar="ftpd_enable" command="/usr/libexec/${name}" pidfile="/var/run/${name}.pid" start_precmd=ftpd_prestart Index: rc.d/mrouted =================================================================== --- rc.d/mrouted (revision 229825) +++ rc.d/mrouted (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="mrouted" -rcvar=`set_rcvar` +rcvar="mrouted_enable" command="/usr/local/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/${name}.conf" Index: rc.d/amd =================================================================== --- rc.d/amd (revision 229825) +++ rc.d/amd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="amd" -rcvar=`set_rcvar` +rcvar="amd_enable" command="/usr/sbin/${name}" start_precmd="amd_precmd" command_args="&" Index: rc.d/devd =================================================================== --- rc.d/devd (revision 229825) +++ rc.d/devd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="devd" -rcvar=`set_rcvar` +rcvar="devd_enable" command="/sbin/${name}" start_precmd=${name}_prestart Index: rc.d/ipxrouted =================================================================== --- rc.d/ipxrouted (revision 229825) +++ rc.d/ipxrouted (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ipxrouted" -rcvar=`set_rcvar` +rcvar="ipxrouted_enable" command="/usr/sbin/IPXrouted" command_args="> /dev/null 2>&1" Index: rc.d/nfsuserd =================================================================== --- rc.d/nfsuserd (revision 229825) +++ rc.d/nfsuserd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="nfsuserd" -rcvar=`set_rcvar` +rcvar="nfsuserd_enable" command="/usr/sbin/${name}" sig_stop="USR1" Index: rc.d/cron =================================================================== --- rc.d/cron (revision 229825) +++ rc.d/cron (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="cron" -rcvar="`set_rcvar`" +rcvar="cron_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Index: rc.d/pflog =================================================================== --- rc.d/pflog (revision 229825) +++ rc.d/pflog (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="pflog" -rcvar=`set_rcvar` +rcvar="pflog_enable" command="/sbin/pflogd" pidfile="/var/run/pflogd.pid" start_precmd="pflog_prestart" Index: rc.d/rwho =================================================================== --- rc.d/rwho (revision 229825) +++ rc.d/rwho (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rwhod" -rcvar="`set_rcvar`" +rcvar="rwhod_enable" command="/usr/sbin/${name}" load_rc_config $name Index: rc.d/ppp =================================================================== --- rc.d/ppp (revision 229825) +++ rc.d/ppp (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ppp" -rcvar=`set_rcvar` +rcvar="ppp_enable" command="/usr/sbin/${name}" start_cmd="ppp_start" stop_cmd="ppp_stop" Index: rc.d/timed =================================================================== --- rc.d/timed (revision 229825) +++ rc.d/timed (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="timed" -rcvar=`set_rcvar` +rcvar="timed_enable" command="/usr/sbin/${name}" load_rc_config $name Index: rc.d/cleanvar =================================================================== --- rc.d/cleanvar (revision 229825) +++ rc.d/cleanvar (working copy) @@ -9,7 +9,7 @@ . /etc/rc.subr name="cleanvar" -rcvar=`set_rcvar` +rcvar="cleanvar_enable" start_precmd="${name}_prestart" start_cmd="${name}_start" Index: rc.d/moused =================================================================== --- rc.d/moused (revision 229825) +++ rc.d/moused (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="moused" -rcvar=`set_rcvar` +rcvar="moused_enable" command="/usr/sbin/${name}" start_cmd="moused_start" pidprefix="/var/run/moused" @@ -23,7 +23,7 @@ # if [ -n "$2" ]; then eval moused_$2_enable=\${moused_$2_enable-${moused_nondefault_enable}} - rcvar=`set_rcvar moused_$2` + rcvar="moused_${2}_enable" pidfile="${pidprefix}.$2.pid" pidarg="-I $pidfile" fi Index: rc.d/bthidd =================================================================== --- rc.d/bthidd (revision 229825) +++ rc.d/bthidd (working copy) @@ -11,9 +11,9 @@ . /etc/rc.subr name="bthidd" +rcvar="bthidd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" -rcvar=`set_rcvar` start_precmd="bthidd_prestart" bthidd_prestart() Index: rc.d/mroute6d =================================================================== --- rc.d/mroute6d (revision 229825) +++ rc.d/mroute6d (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="mroute6d" -rcvar=`set_rcvar` +rcvar="mroute6d_enable" command="/usr/local/sbin/pim6dd" load_rc_config $name Index: rc.d/apm =================================================================== --- rc.d/apm (revision 229825) +++ rc.d/apm (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="apm" -rcvar=`set_rcvar` +rcvar="apm_enable" start_precmd="apm_precmd" command="/usr/sbin/${name}" start_cmd="${command} -e enable" Index: rc.d/syslogd =================================================================== --- rc.d/syslogd (revision 229825) +++ rc.d/syslogd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="syslogd" -rcvar=`set_rcvar` +rcvar="syslogd_enable" pidfile="/var/run/syslog.pid" command="/usr/sbin/${name}" required_files="/etc/syslog.conf" @@ -41,7 +41,7 @@ # for _l in $altlog_proglist; do eval _ldir=\$${_l}_chrootdir - if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then + if checkyesno ${_l}_enable && [ -n "$_ldir" ]; then echo "${_ldir}/var/run/log" >> $sockfile fi done Index: rc.d/keyserv =================================================================== --- rc.d/keyserv (revision 229825) +++ rc.d/keyserv (working copy) @@ -13,7 +13,7 @@ . /etc/rc.subr name="keyserv" -rcvar=`set_rcvar` +rcvar="keyserv_enable" command="/usr/sbin/${name}" start_precmd="keyserv_prestart" Index: rc.d/hostapd =================================================================== --- rc.d/hostapd (revision 229825) +++ rc.d/hostapd (working copy) @@ -10,8 +10,8 @@ . /etc/rc.subr name="hostapd" +rcvar="hostapd_enable" command="/usr/sbin/${name}" -rcvar=`set_rcvar` conf_file="/etc/${name}.conf" pidfile="/var/run/${name}.pid" Index: rc.d/inetd =================================================================== --- rc.d/inetd (revision 229825) +++ rc.d/inetd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="inetd" -rcvar=`set_rcvar` +rcvar="inetd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/${name}.conf" Index: rc.d/virecover =================================================================== --- rc.d/virecover (revision 229825) +++ rc.d/virecover (working copy) @@ -12,7 +12,7 @@ . /etc/rc.subr name="virecover" -rcvar="`set_rcvar`" +rcvar="virecover_enable" stop_cmd=":" start_cmd="virecover_start" Index: rc.d/ipfilter =================================================================== --- rc.d/ipfilter (revision 229825) +++ rc.d/ipfilter (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ipfilter" -rcvar=`set_rcvar` +rcvar="ipfilter_enable" load_rc_config $name stop_precmd="test -f ${ipfilter_rules} -o -f ${ipv6_ipfilter_rules}" Index: rc.d/apmd =================================================================== --- rc.d/apmd (revision 229825) +++ rc.d/apmd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="apmd" -rcvar=`set_rcvar` +rcvar="apmd_enable" command="/usr/sbin/${name}" start_precmd="apmd_prestart" Index: rc.d/natd =================================================================== --- rc.d/natd (revision 229825) +++ rc.d/natd (working copy) @@ -10,7 +10,7 @@ . /etc/network.subr name="natd" -rcvar=`set_rcvar` +rcvar="natd_enable" command="/sbin/${name}" pidfile="/var/run/${name}.pid" start_precmd="natd_precmd" Index: rc.d/route6d =================================================================== --- rc.d/route6d (revision 229825) +++ rc.d/route6d (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="route6d" -rcvar=`set_rcvar` +rcvar="route6d_enable" set_rcvar_obsolete ipv6_router_enable route6d_enable set_rcvar_obsolete ipv6_router route6d_program Index: rc.d/hcsecd =================================================================== --- rc.d/hcsecd (revision 229825) +++ rc.d/hcsecd (working copy) @@ -11,9 +11,9 @@ . /etc/rc.subr name="hcsecd" +rcvar="hcsecd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" -rcvar=`set_rcvar` required_modules="ng_btsocket" load_rc_config $name Index: rc.d/hastd =================================================================== --- rc.d/hastd (revision 229825) +++ rc.d/hastd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="hastd" -rcvar=`set_rcvar` +rcvar="hastd_enable" pidfile="/var/run/${name}.pid" command="/sbin/${name}" hastctl="/sbin/hastctl" Index: rc.d/ipmon =================================================================== --- rc.d/ipmon (revision 229825) +++ rc.d/ipmon (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ipmon" -rcvar=`set_rcvar` +rcvar="ipmon_enable" command="/sbin/${name}" start_precmd="ipmon_precmd" Index: rc.d/bsnmpd =================================================================== --- rc.d/bsnmpd (revision 229825) +++ rc.d/bsnmpd (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="bsnmpd" -rcvar=`set_rcvar` +rcvar="bsnmpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/snmpd.pid" Index: rc.d/accounting =================================================================== --- rc.d/accounting (revision 229825) +++ rc.d/accounting (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="accounting" -rcvar=`set_rcvar` +rcvar="accounting_enable" accounting_command="/usr/sbin/accton" accounting_file="/var/account/acct" Index: rc.d/sdpd =================================================================== --- rc.d/sdpd (revision 229825) +++ rc.d/sdpd (working copy) @@ -12,7 +12,7 @@ name="sdpd" command="/usr/sbin/${name}" -rcvar=`set_rcvar` +rcvar="sdpd_enable" required_modules="ng_btsocket" load_rc_config $name Index: rc.d/ipfs =================================================================== --- rc.d/ipfs (revision 229825) +++ rc.d/ipfs (working copy) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ipfs" -rcvar=`set_rcvar` +rcvar="ipfs_enable" start_cmd="ipfs_start" stop_cmd="ipfs_stop" start_precmd="ipfs_prestart" Index: rc.d/rtadvd =================================================================== --- rc.d/rtadvd (revision 229825) +++ rc.d/rtadvd (working copy) @@ -12,7 +12,7 @@ . /etc/network.subr name="rtadvd" -rcvar=`set_rcvar` +rcvar="rtadvd_enable" command="/usr/sbin/${name}" start_precmd="rtadvd_precmd" Index: rc.d/newsyslog =================================================================== --- rc.d/newsyslog (revision 229825) +++ rc.d/newsyslog (working copy) @@ -9,7 +9,7 @@ . /etc/rc.subr name="newsyslog" -rcvar=`set_rcvar` +rcvar="newsyslog_enable" required_files="/etc/newsyslog.conf" command="/usr/sbin/${name}" start_cmd="newsyslog_start" Index: rc.d/ipsec =================================================================== --- rc.d/ipsec (revision 229825) +++ rc.d/ipsec (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ipsec" -rcvar=`set_rcvar` +rcvar="ipsec_enable" start_precmd="ipsec_prestart" start_cmd="ipsec_start" stop_precmd="test -f $ipsec_file" Index: rc.d/ntpd =================================================================== --- rc.d/ntpd (revision 229825) +++ rc.d/ntpd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ntpd" -rcvar=`set_rcvar` +rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" start_precmd="ntpd_precmd" Index: rc.d/cleartmp =================================================================== --- rc.d/cleartmp (revision 229825) +++ rc.d/cleartmp (working copy) @@ -11,7 +11,7 @@ name="cleartmp" # Disguise rcvar for the start method to run irrespective of its setting. -rcvar1=`set_rcvar clear_tmp` +rcvar1="clear_tmp_enable" start_cmd="${name}_start" stop_cmd=":" Index: rc.d/rarpd =================================================================== --- rc.d/rarpd (revision 229825) +++ rc.d/rarpd (working copy) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rarpd" -rcvar=`set_rcvar` +rcvar="rarpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/ethers" Index: rc.subr =================================================================== --- rc.subr (revision 229822) +++ rc.subr (working copy) @@ -54,47 +54,6 @@ # functions # --------- -# set_rcvar [var] [defval] [desc] -# -# Echo or define a rc.conf(5) variable name. Global variable -# $rcvars is used. -# -# If no argument is specified, echo "${name}_enable". -# -# If only a var is specified, echo "${var}_enable". -# -# If var and defval are specified, the ${var} is defined as -# rc.conf(5) variable and the default value is ${defvar}. An -# optional argument $desc can also be specified to add a -# description for that. -# -set_rcvar() -{ - case $# in - 0) - echo ${name}_enable - ;; - 1) - echo ${1}_enable - ;; - *) - debug "rcvar_define: \$$1=$2 is added" \ - " as a rc.conf(5) variable." - - local _var - _var=$1 - rcvars="${rcvars# } $_var" - eval ${_var}_defval=\"$2\" - shift 2 - # encode multiple lines of _desc - for l in "$@"; do - eval ${_var}_desc=\"\${${_var}_desc#^^}^^$l\" - done - eval ${_var}_desc=\"\${${_var}_desc#^^}\" - ;; - esac -} - # set_rcvar_obsolete oldvar [newvar] [msg] # Define obsolete variable. # Global variable $rcvars_obsolete is used. @@ -856,8 +815,8 @@ echo "" fi echo "#" - # Get unique vars in $rcvar $rcvars - for _v in $rcvar $rcvars; do + # Get unique vars in $rcvar + for _v in $rcvar; do case $v in $_v\ *|\ *$_v|*\ $_v\ *) ;; *) v="${v# } $_v" ;; @@ -1003,7 +962,7 @@ unset name command command_args command_interpreter \ extra_commands pidfile procname \ - rcvar rcvars rcvars_obsolete required_dirs required_files \ + rcvar rcvars_obsolete required_dirs required_files \ required_vars eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd @@ -1035,7 +994,7 @@ # load_rc_config() { - local _name _var _defval _v _msg _new + local _name _rcvar_val _var _defval _v _msg _new _name=$1 if [ -z "$_name" ]; then err 3 'USAGE: load_rc_config name' @@ -1060,7 +1019,7 @@ fi # Set defaults if defined. - for _var in $rcvar $rcvars; do + for _var in $rcvar; do eval _defval=\$${_var}_defval if [ -n "$_defval" ]; then eval : \${$_var:=\$${_var}_defval} --------------000209040905030802020303-- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 09:54:02 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 805371065673 for ; Mon, 9 Jan 2012 09:54:02 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm1-vm0.bullet.mail.ne1.yahoo.com (nm1-vm0.bullet.mail.ne1.yahoo.com [98.138.91.74]) by mx1.freebsd.org (Postfix) with SMTP id 0409E8FC16 for ; Mon, 9 Jan 2012 09:54:01 +0000 (UTC) Received: from [98.138.90.56] by nm1.bullet.mail.ne1.yahoo.com with NNFMP; 09 Jan 2012 09:40:30 -0000 Received: from [98.138.226.30] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 09 Jan 2012 09:40:30 -0000 Received: from [127.0.0.1] by smtp201.mail.ne1.yahoo.com with NNFMP; 09 Jan 2012 09:40:29 -0000 X-Yahoo-Newman-Id: 977230.91659.bm@smtp201.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: M9o5FVMVM1m_Dk.o8BaobB6bMGfokYuwZoESTRoec1M5Lz2 uNJnnTiZEoKkNv1o0aoLRUu_Ab8FmjeMgIPk6RoZ5N97INzu.uED.cyVu1Fx mG5Ox9vUxhi0YFqLTTQPxRTJ1P6mfETKbVw4s5xv1FEVSOmOEd8_Hf3cYO_3 nFV9Rpo_iCuVORqPy57MwqnmAjESkdWgqQWLF3Or4RhFqH8OiK3..Vc2KV6t M72opBfJX1AMhVWqNX.XbsXEP1TXSUtWAo1_re_0BPWjcm.UkyOYP01J6G8M TjPTha5Bq6rxCslfIrCqB7GlfIUIaO4vauaQd_RTEYAChK8rO0cgjgNOV4Fi PTnwH.R76WVJxb5qh2T_HoDL1u6wMr7x7K2O9XbjR9Yr4.UOoRxjUpaadDIj 2KGdA5OTU5oaJCzOoiTiE7xZsq_w- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. Received: from [192.168.119.20] (se@81.173.145.201 with plain) by smtp201.mail.ne1.yahoo.com with SMTP; 09 Jan 2012 01:40:29 -0800 PST Message-ID: <4F0AB60E.7090601@freebsd.org> Date: Mon, 09 Jan 2012 10:40:30 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Doug Barton References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> In-Reply-To: <4F0A22D8.8090206@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Hiroki Sato , freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 09:54:02 -0000 Am 09.01.2012 00:12, schrieb Doug Barton: > Attached is a patch that does what I suggested a long time ago, removes > set_rcvar() entirely and assigns each rcvar statically. I'll commit this > in a few days if no one objects. (Note, it can't be committed yet > because the scripts in ports that call set_rcvar() have to be modified > first.) [...] > Index: rc.d/nscd > =================================================================== > --- rc.d/nscd (revision 229825) > +++ rc.d/nscd (working copy) > @@ -19,7 +19,7 @@ > . /etc/rc.subr > > name="nscd" > -rcvar=`set_rcvar` > +rcvar="nscd_enable" Why not generally use rcvar="${name}_enable" instead of (e.g.) rcvar="nscd_enable" in all scripts *in your patch set*, for which the outcome is the same? All except for sendmail_submit_enable, sendmail_outbound_enable, nfs_server_enable, moused_${2}_enable and clear_tmp_enable. But for nfsd vs. nfs_server and cleartmp vs. clear_tmp it might be a good idea to modify $name to match the value of the _enable parameter, anyway. Then only the special cases sendmail_*_enable and moused_*_enable would persist. The use of "${name}_enable" does not add measurable overhead, but that way more of an existing script might be used as a prototype unchanged. But using ${name}_enable enforces the use of an enable parameter that actually is based on $name, not a slight variation thereof (ISTR such cases existed and had to be fixed to avoid confusion). Regards, STefan From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 10:14:30 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 2B6C1106566C; Mon, 9 Jan 2012 10:14:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 344EC1558BB; Mon, 9 Jan 2012 10:14:29 +0000 (UTC) Message-ID: <4F0ABE04.5050503@FreeBSD.org> Date: Mon, 09 Jan 2012 02:14:28 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Stefan Esser References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <4F0AB60E.7090601@freebsd.org> In-Reply-To: <4F0AB60E.7090601@freebsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Hiroki Sato , freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 10:14:30 -0000 On 01/09/2012 01:40, Stefan Esser wrote: > Am 09.01.2012 00:12, schrieb Doug Barton: >> Attached is a patch that does what I suggested a long time ago, removes >> set_rcvar() entirely and assigns each rcvar statically. I'll commit this >> in a few days if no one objects. (Note, it can't be committed yet >> because the scripts in ports that call set_rcvar() have to be modified >> first.) > [...] >> Index: rc.d/nscd >> =================================================================== >> --- rc.d/nscd (revision 229825) >> +++ rc.d/nscd (working copy) >> @@ -19,7 +19,7 @@ >> . /etc/rc.subr >> >> name="nscd" >> -rcvar=`set_rcvar` >> +rcvar="nscd_enable" > > Why not generally use > > rcvar="${name}_enable" > > instead of (e.g.) > > rcvar="nscd_enable" > > in all scripts *in your patch set*, for which the outcome is the same? Because there is no good reason to add an extra layer of indirection. IMO we should actually dereference all instances of $name in the scripts, but I don't want to create the churn without good reason. > But for nfsd vs. nfs_server and cleartmp vs. clear_tmp it might be a > good idea to modify $name to match the value of the _enable parameter, > anyway. > Then only the special cases sendmail_*_enable and moused_*_enable would > persist. That sounds great, are you going to handle all the compatibility shims, through the next 2 major releases? These knobs are not just used internally, they are in users' rc.conf[.local] files. Changing the special cases shouldn't be done without a really good reason. The purpose (in part) of having a distinct $rcvar value in the first place is to deal with them. > The use of "${name}_enable" does not add measurable overhead, but that > way more of an existing script might be used as a prototype unchanged. I understand what you're saying, and I know that the whole "use variables wherever we can" thing is all '1337 and computer science'y, but it's silly. The concept of a universal template that can be copied and pasted for different services is a pipe dream. There are already many things that need to be changed in the new script, and not updating rcvar for a new script causes clear and obvious failure messages. > But using ${name}_enable enforces the use of an enable parameter that > actually is based on $name, not a slight variation thereof (ISTR such > cases existed and had to be fixed to avoid confusion). For all new scripts we enforce == PROVIDE == $name (and by extension rcvar="${name}_enable"). That's all part and parcel of the same code review, so there is no reason to believe that requiring use of the variable is going to cause proper code review any better than actually, you know, doing proper code review. Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 10:22:40 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5064C1065670; Mon, 9 Jan 2012 10:22:40 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id F3EC38FC14; Mon, 9 Jan 2012 10:22:39 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 6F6767B1; Mon, 9 Jan 2012 11:22:38 +0100 (CET) Date: Mon, 9 Jan 2012 11:21:30 +0100 From: Pawel Jakub Dawidek To: Stefan Esser Message-ID: <20120109102129.GA4117@garage.freebsd.pl> References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <4F0AB60E.7090601@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline In-Reply-To: <4F0AB60E.7090601@freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Doug Barton , freebsd-rc@FreeBSD.org, Hiroki Sato Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 10:22:40 -0000 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 09, 2012 at 10:40:30AM +0100, Stefan Esser wrote: > Am 09.01.2012 00:12, schrieb Doug Barton: > > Attached is a patch that does what I suggested a long time ago, removes > > set_rcvar() entirely and assigns each rcvar statically. I'll commit this > > in a few days if no one objects. (Note, it can't be committed yet > > because the scripts in ports that call set_rcvar() have to be modified > > first.) > [...] > > Index: rc.d/nscd > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- rc.d/nscd (revision 229825) > > +++ rc.d/nscd (working copy) > > @@ -19,7 +19,7 @@ > > . /etc/rc.subr > > > > name=3D"nscd" > > -rcvar=3D`set_rcvar` > > +rcvar=3D"nscd_enable" >=20 > Why not generally use >=20 > rcvar=3D"${name}_enable" >=20 > instead of (e.g.) >=20 > rcvar=3D"nscd_enable" >=20 > in all scripts *in your patch set*, for which the outcome is the same? I fully agree. There is one less thing to change after reusing a script. I can't see how this might be a bad idea, really. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --n8g4imXOkfNTN/H1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8Kv6kACgkQForvXbEpPzTQPQCfSnhWRRriWKFaUFZA4OiOFsHZ R/YAniGIUcT3szuviGkXAQa/qa8w02cn =7oDI -----END PGP SIGNATURE----- --n8g4imXOkfNTN/H1-- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 10:26:09 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 7C427106564A; Mon, 9 Jan 2012 10:26:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id D7C3E1550B3; Mon, 9 Jan 2012 10:26:07 +0000 (UTC) Message-ID: <4F0AC0BF.3050709@FreeBSD.org> Date: Mon, 09 Jan 2012 02:26:07 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <4F0AB60E.7090601@freebsd.org> <20120109102129.GA4117@garage.freebsd.pl> In-Reply-To: <20120109102129.GA4117@garage.freebsd.pl> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org, Hiroki Sato Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 10:26:09 -0000 On 01/09/2012 02:21, Pawel Jakub Dawidek wrote: > On Mon, Jan 09, 2012 at 10:40:30AM +0100, Stefan Esser wrote: >> Am 09.01.2012 00:12, schrieb Doug Barton: >>> Attached is a patch that does what I suggested a long time ago, removes >>> set_rcvar() entirely and assigns each rcvar statically. I'll commit this >>> in a few days if no one objects. (Note, it can't be committed yet >>> because the scripts in ports that call set_rcvar() have to be modified >>> first.) >> [...] >>> Index: rc.d/nscd >>> =================================================================== >>> --- rc.d/nscd (revision 229825) >>> +++ rc.d/nscd (working copy) >>> @@ -19,7 +19,7 @@ >>> . /etc/rc.subr >>> >>> name="nscd" >>> -rcvar=`set_rcvar` >>> +rcvar="nscd_enable" >> >> Why not generally use >> >> rcvar="${name}_enable" >> >> instead of (e.g.) >> >> rcvar="nscd_enable" >> >> in all scripts *in your patch set*, for which the outcome is the same? > > I fully agree. There is one less thing to change after reusing a script. > I can't see how this might be a bad idea, really. See my previous response. If you still need help with that "search and replace" thing I can walk you through it in vi. If you're an emacs user, you're on your own though, sorry. :) Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 11:07:12 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C0361065670 for ; Mon, 9 Jan 2012 11:07:12 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 68F548FC12 for ; Mon, 9 Jan 2012 11:07:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q09B7CBH042292 for ; Mon, 9 Jan 2012 11:07:12 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q09B7B4Z042290 for freebsd-rc@FreeBSD.org; Mon, 9 Jan 2012 11:07:11 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 9 Jan 2012 11:07:11 GMT Message-Id: <201201091107.q09B7B4Z042290@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 11:07:12 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/163508 rc [rc.subr] [patch] Add "enable" and "disable" commands o conf/163488 rc Confusing explanation in defaults/rc.conf o conf/163321 rc [rc.conf] [patch] allow _fib syntax in rc.conf o conf/162642 rc .sh scripts in /usr/local/etc/rc.d get executed, not s o conf/161107 rc [rc] stop_boot in mountcritlocal usage is incorrect. o conf/160403 rc [rc] [patch] concurrently running rc-scripts during bo o conf/160240 rc rc.d/mdconfig and mdconfig2 should autoset $_type to v o conf/159846 rc [rc.conf] routing_stop_inet6() logic doesn't handle ip o conf/158557 rc [patch] /etc/rc.d/pf broken messages o conf/158127 rc [patch] remount_optional option in rc.initdiskless doe o conf/154554 rc [rc.d] [patch] statd and lockd fail to start o conf/153666 rc [rc.d][patch] mount filesystems from fstab over zfs da o conf/153200 rc post-boot /etc/rc.d/network_ipv6 start can miss neighb o conf/153123 rc [rc] [patch] add gsched rc file to automatically inser o conf/150474 rc [patch] rc.d/accounting: Add ability to set location o o conf/149867 rc [PATCH] rc.d script to manage multiple FIBS (kern opti o conf/149831 rc [PATCH] add support to /etc/rc.d/jail for delegating Z o conf/148656 rc rc.firewall(8): {oip} and {iip} variables in rc.firewa o conf/147685 rc [rc.d] [patch] new feature for /etc/rc.d/fsck o conf/147444 rc [rc.d] [patch] /etc/rc.d/zfs stop not called on reboot o conf/146053 rc [patch] [request] shutdown of jails breaks inter-jail o conf/145445 rc [rc.d] error in /etc/rc.d/jail (bad logic) o conf/145440 rc [rc.d] [patch] add multiple fib support (setfib) in /e o conf/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145009 rc [patch] rc.subr(8): rc.conf should allow mac label con o conf/144213 rc [rc.d] [patch] Disappearing zvols on reboot o conf/143637 rc [patch] ntpdate(8) support for ntp-servers supplied by o conf/143085 rc [patch] ftp-proxy(8) rc(8) with multiple instances o conf/143084 rc [jail] [patch]: fix rc.d/jail creating stray softlinks o conf/142973 rc [jail] [patch] Strange counter init value in jail rc o conf/142434 rc [patch] Add cpuset(1) support to rc.subr(8) o conf/142304 rc rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack e o conf/141909 rc rc.subr(8): [patch] add rc.conf.d support to /usr/loca o conf/141907 rc [rc.d] Bug if mtu (maybe others?) is set as first argu o conf/141678 rc [patch] A minor enhancement to how /etc/rc.d/jail dete o conf/141275 rc [request] dhclient(8) rc script should print something o conf/140440 rc [patch] allow local command files in rc.{suspend,resum o conf/140261 rc [patch] Improve flexibility of mdconfig2 startup scrip o conf/138208 rc [rc.d] [patch] Making rc.firewall (workstation) IPv6 a o conf/137629 rc [rc.d] background_dhclient rc.conf option causing doub o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/137271 rc [rc.d] Cannot update /etc/host.conf when root filesyst o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/135338 rc [rc.d] pf startup order seems broken [regression] o conf/134918 rc [patch] rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped p bin/126324 rc [patch] rc.d/tmp: Prevent mounting /tmp in second tim o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). o conf/123119 rc [patch] rc script for ipfw does not handle IPv6 o conf/122968 rc [rc.d] /etc/rc.d/addswap: md swapfile multiplication a o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug o conf/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/109272 rc [request] increase default rc shutdown timeout o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 94 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 13:42:13 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06C6C106564A; Mon, 9 Jan 2012 13:42:13 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A80978FC08; Mon, 9 Jan 2012 13:42:12 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 82939857; Mon, 9 Jan 2012 14:42:10 +0100 (CET) Date: Mon, 9 Jan 2012 14:41:02 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20120109134101.GD4117@garage.freebsd.pl> References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <4F0AB60E.7090601@freebsd.org> <20120109102129.GA4117@garage.freebsd.pl> <4F0AC0BF.3050709@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0/kgSOzhNoDC5T3a" Content-Disposition: inline In-Reply-To: <4F0AC0BF.3050709@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-rc@FreeBSD.org, Hiroki Sato Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 13:42:13 -0000 --0/kgSOzhNoDC5T3a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 09, 2012 at 02:26:07AM -0800, Doug Barton wrote: > On 01/09/2012 02:21, Pawel Jakub Dawidek wrote: > > On Mon, Jan 09, 2012 at 10:40:30AM +0100, Stefan Esser wrote: > >> Am 09.01.2012 00:12, schrieb Doug Barton: > >>> Attached is a patch that does what I suggested a long time ago, remov= es > >>> set_rcvar() entirely and assigns each rcvar statically. I'll commit t= his > >>> in a few days if no one objects. (Note, it can't be committed yet > >>> because the scripts in ports that call set_rcvar() have to be modified > >>> first.) > >> [...] > >>> Index: rc.d/nscd > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>> --- rc.d/nscd (revision 229825) > >>> +++ rc.d/nscd (working copy) > >>> @@ -19,7 +19,7 @@ > >>> . /etc/rc.subr > >>> > >>> name=3D"nscd" > >>> -rcvar=3D`set_rcvar` > >>> +rcvar=3D"nscd_enable" > >> > >> Why not generally use > >> > >> rcvar=3D"${name}_enable" > >> > >> instead of (e.g.) > >> > >> rcvar=3D"nscd_enable" > >> > >> in all scripts *in your patch set*, for which the outcome is the same? > >=20 > > I fully agree. There is one less thing to change after reusing a script. > > I can't see how this might be a bad idea, really. >=20 > See my previous response. I saw your e-mail before agreeing with Stefan's proposal. And let me repeat myself: I can't see how this might be a bad idea. Do you? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --0/kgSOzhNoDC5T3a Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8K7m0ACgkQForvXbEpPzRDiQCgww/Cmw8WnGw2+E9gv9vgGemk hxIAoOmiuXrWp3msQiuBeY0wqc7VJwn9 =fi3p -----END PGP SIGNATURE----- --0/kgSOzhNoDC5T3a-- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 13:43:38 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDFCD106567F; Mon, 9 Jan 2012 13:43:37 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id D59008FC24; Mon, 9 Jan 2012 13:43:36 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q09DhNjL057604; Mon, 9 Jan 2012 22:43:33 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q09DhLFE095964; Mon, 9 Jan 2012 22:43:23 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 09 Jan 2012 22:35:10 +0900 (JST) Message-Id: <20120109.223510.1979757999064039809.hrs@allbsd.org> To: dougb@FreeBSD.org From: Hiroki Sato In-Reply-To: <4F0A22D8.8090206@FreeBSD.org> <4F0ABE04.5050503@FreeBSD.org> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3.51 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jan__9_22_35_10_2012_563)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Mon, 09 Jan 2012 22:43:33 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 13:43:38 -0000 ----Security_Multipart(Mon_Jan__9_22_35_10_2012_563)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <4F0A22D8.8090206@FreeBSD.org>: do> On 01/07/2012 15:12, Hiroki Sato wrote: do> > I am always wondering if defining $rcvar as "${name}_enable" at the do> > end of load_rc_config() when $rcvar is undefined is bad idea. do> > do> > Is there any problem with removing rcvar=... in individual rc.d do> > scripts except for non-standard ones (empty or different from do> > ${name}_enable)? It looks simpler than writing the same line do> > "rcvar=${name}_enable" many times in various places. do> do> This sounds like a great idea in theory, but in practice it doesn't work do> out, for 2 reasons. First, we have a lot of scripts in the base (about do> 1/3) that rely on the lack of any rcvar meaning that it gets run do> unconditionally. In order to provide backwards compatibility we'd have do> to add code to enable things by default that were previously unset. do> That's not hard to do, but .... do> do> The other reason is that for ports, the scripts generally look like this: do> do> load_rc_config foo do> do> : ${foo_enable:=NO} do> do> See the problem? Removing rcvar=`set_rcvar`, and then adding rcvar="" into scripts that need to be run unconditionally would work. However, I have no strong opinion about that. I agree that it needs some more code anyway and keeping things simple is better. Doug Barton wrote in <4F0ABE04.5050503@FreeBSD.org>: do> > The use of "${name}_enable" does not add measurable overhead, but that do> > way more of an existing script might be used as a prototype unchanged. do> do> I understand what you're saying, and I know that the whole "use do> variables wherever we can" thing is all '1337 and computer science'y, do> but it's silly. The concept of a universal template that can be copied do> and pasted for different services is a pipe dream. There are already do> many things that need to be changed in the new script, and not updating do> rcvar for a new script causes clear and obvious failure messages. I prefer to use ${name}_enable because putting the same keyword in two places always leads to a stupid typo issue. -- Hiroki ----Security_Multipart(Mon_Jan__9_22_35_10_2012_563)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8K7Q4ACgkQTyzT2CeTzy2MFwCg2GXL8vB04QFHfJ5uqw6x+V54 WuAAnAwz8bq5n5eY5JI2luYPr1TF6t+Q =C6H7 -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jan__9_22_35_10_2012_563)---- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 16:17:37 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 982BE106564A; Mon, 9 Jan 2012 16:17:37 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 407328FC13; Mon, 9 Jan 2012 16:17:36 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so5906026obb.13 for ; Mon, 09 Jan 2012 08:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=RYXbg5GNv3gTD5BzuoZd2U5txWuq4pVeAiURpIIikik=; b=cHIAkQC6pQHB/+3NQc1lbYysyFdokXJQdWe/vzPaWoinZ893WVA/hKupEF+B+9bq5v wEnSRMeTFi0qHfYxbNtyQEI6PQcFQhT+uBU7qLjocQa1REH0oAFm5Ze/9CXq4ZkfQtY+ Si9gv3Wc2uhnh/1M1FotTuFscymdN/j/va3Ro= Received: by 10.182.109.106 with SMTP id hr10mr15287759obb.27.1326125856601; Mon, 09 Jan 2012 08:17:36 -0800 (PST) Received: from [192.168.20.12] (c-24-6-49-154.hsd1.ca.comcast.net. [24.6.49.154]) by mx.google.com with ESMTPS id g9sm4184680obm.0.2012.01.09.08.17.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jan 2012 08:17:35 -0800 (PST) References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> In-Reply-To: <20120109.223510.1979757999064039809.hrs@allbsd.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (9A405) From: Garrett Cooper Date: Mon, 9 Jan 2012 08:17:30 -0800 To: Hiroki Sato Cc: "dougb@FreeBSD.org" , "freebsd-rc@FreeBSD.org" Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 16:17:37 -0000 On Jan 9, 2012, at 5:35 AM, Hiroki Sato wrote: > Doug Barton wrote > in <4F0A22D8.8090206@FreeBSD.org>: >=20 > do> On 01/07/2012 15:12, Hiroki Sato wrote: > do> > I am always wondering if defining $rcvar as "${name}_enable" at the= > do> > end of load_rc_config() when $rcvar is undefined is bad idea. > do> > > do> > Is there any problem with removing rcvar=3D... in individual rc.d > do> > scripts except for non-standard ones (empty or different from > do> > ${name}_enable)? It looks simpler than writing the same line > do> > "rcvar=3D${name}_enable" many times in various places. > do> > do> This sounds like a great idea in theory, but in practice it doesn't wo= rk > do> out, for 2 reasons. First, we have a lot of scripts in the base (about= > do> 1/3) that rely on the lack of any rcvar meaning that it gets run > do> unconditionally. In order to provide backwards compatibility we'd have= > do> to add code to enable things by default that were previously unset. > do> That's not hard to do, but .... > do> > do> The other reason is that for ports, the scripts generally look like th= is: > do> > do> load_rc_config foo > do> > do> : ${foo_enable:=3DNO} > do> > do> See the problem? >=20 > Removing rcvar=3D`set_rcvar`, and then adding rcvar=3D"" into scripts > that need to be run unconditionally would work. However, I have no > strong opinion about that. I agree that it needs some more code > anyway and keeping things simple is better. >=20 > Doug Barton wrote > in <4F0ABE04.5050503@FreeBSD.org>: >=20 > do> > The use of "${name}_enable" does not add measurable overhead, but th= at > do> > way more of an existing script might be used as a prototype unchange= d. > do> > do> I understand what you're saying, and I know that the whole "use > do> variables wherever we can" thing is all '1337 and computer science'y, > do> but it's silly. The concept of a universal template that can be copied= > do> and pasted for different services is a pipe dream. There are already > do> many things that need to be changed in the new script, and not updatin= g > do> rcvar for a new script causes clear and obvious failure messages. >=20 > I prefer to use ${name}_enable because putting the same keyword in > two places always leads to a stupid typo issue. +1 Thanks, -Garrett= From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 17:12:13 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85E711065670; Mon, 9 Jan 2012 17:12:13 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3268FC15; Mon, 9 Jan 2012 17:12:12 +0000 (UTC) Received: from pps.filterd (ltcfislmsgpa05 [127.0.0.1]) by ltcfislmsgpa05.fnfis.com (8.14.4/8.14.4) with SMTP id q09GfdPL010340; Mon, 9 Jan 2012 11:12:11 -0600 Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa05.fnfis.com with ESMTP id 1283yk84ar-12 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 09 Jan 2012 11:12:11 -0600 Received: from dtwin (10.14.152.15) by smtp.fisglobal.com (10.132.206.15) with Microsoft SMTP Server (TLS) id 14.1.323.3; Mon, 9 Jan 2012 11:12:07 -0600 From: Devin Teske To: "'Garrett Cooper'" , "'Hiroki Sato'" References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> In-Reply-To: Date: Mon, 9 Jan 2012 09:12:07 -0800 Message-ID: <07de01cccef1$d2e73630$78b5a290$@fisglobal.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGQR4hqSCIYbzlOaK1Sfp0UW7jaygHdB8ZrApGUiKoBrkYqVwKW/xRxlje1QZA= Content-Language: en-us X-Originating-IP: [10.14.152.15] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2012-01-09_06:2012-01-09, 2012-01-09, 1970-01-01 signatures=0 Cc: dougb@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: RE: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 17:12:13 -0000 > -----Original Message----- > From: owner-freebsd-rc@freebsd.org [mailto:owner-freebsd-rc@freebsd.org] > On Behalf Of Garrett Cooper > Sent: Monday, January 09, 2012 8:18 AM > To: Hiroki Sato > Cc: dougb@FreeBSD.org; freebsd-rc@FreeBSD.org > Subject: Re: Making use of set_rcvar. > > On Jan 9, 2012, at 5:35 AM, Hiroki Sato wrote: > > > Doug Barton wrote > > in <4F0A22D8.8090206@FreeBSD.org>: > > > > do> On 01/07/2012 15:12, Hiroki Sato wrote: > > do> > I am always wondering if defining $rcvar as "${name}_enable" at > > do> > the end of load_rc_config() when $rcvar is undefined is bad idea. > > do> > > > do> > Is there any problem with removing rcvar=... in individual rc.d > > do> > scripts except for non-standard ones (empty or different from > > do> > ${name}_enable)? It looks simpler than writing the same line > > do> > "rcvar=${name}_enable" many times in various places. > > do> > > do> This sounds like a great idea in theory, but in practice it > > do> doesn't work out, for 2 reasons. First, we have a lot of scripts > > do> in the base (about > > do> 1/3) that rely on the lack of any rcvar meaning that it gets run > > do> unconditionally. In order to provide backwards compatibility we'd > > do> have to add code to enable things by default that were previously unset. > > do> That's not hard to do, but .... > > do> > > do> The other reason is that for ports, the scripts generally look like this: > > do> > > do> load_rc_config foo > > do> > > do> : ${foo_enable:=NO} > > do> > > do> See the problem? > > > > Removing rcvar=`set_rcvar`, and then adding rcvar="" into scripts that > > need to be run unconditionally would work. However, I have no strong > > opinion about that. I agree that it needs some more code anyway and > > keeping things simple is better. > > > > Doug Barton wrote > > in <4F0ABE04.5050503@FreeBSD.org>: > > > > do> > The use of "${name}_enable" does not add measurable overhead, > > do> > but that way more of an existing script might be used as a prototype > unchanged. > > do> > > do> I understand what you're saying, and I know that the whole "use > > do> variables wherever we can" thing is all '1337 and computer > > do> science'y, but it's silly. The concept of a universal template > > do> that can be copied and pasted for different services is a pipe > > do> dream. There are already many things that need to be changed in > > do> the new script, and not updating rcvar for a new script causes clear and > obvious failure messages. > > > > I prefer to use ${name}_enable because putting the same keyword in two > > places always leads to a stupid typo issue. > > +1 > Thanks, > -Garrett +1 again. -- Devin _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. From owner-freebsd-rc@FreeBSD.ORG Wed Jan 11 05:57:45 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C6C1065672; Wed, 11 Jan 2012 05:57:45 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 843868FC08; Wed, 11 Jan 2012 05:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=bKcmE//DzddyQcw5vUdGsYdf+Ma6tmV0PdhBPJ2urls=; b=R4SFMG5F0gXR8U+QRLK25y0A56pTk0YHUFXfVA/UyZMwqOMjN7eSkorr7mQ4VslmCDQWixkvkCTdgeSGELueR3r4u0crJEWIx/zEBXwSJ++eyMiQBDHFl2oOHsOVuuC+ZJSqRHmBo+GSm1sm49e6wIsZu+XMlhpj/TKeist+GytyVG0nMH1P8AWchNp/gLINYzmKcdPDM4R3gBF5Ngcw2zaMVDSI975nyXfjLuKNATWUBy9r5OLmTtA4hKmLwU0WzF2gVLUR76dxhFftgDIQX4QtEflN0+DxCeup/r73IdGZ8GAzLJ0qKRfXHtm3fu1P9VfQ3tnjfG8QfEcAi5YPtw==; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1RkrBw-000DWa-2V; Wed, 11 Jan 2012 08:57:44 +0300 Date: Wed, 11 Jan 2012 09:57:42 +0400 From: Eygene Ryabinkin To: Mike Telahun Makonnen Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sxUMTo9WXJrtNoGr" Content-Disposition: inline In-Reply-To: Sender: rea@codelabs.ru Cc: gordon@freebsd.org, freebsd-rc@freebsd.org Subject: Re: Usage of the err() inside rc.d scripts X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 05:57:46 -0000 --sxUMTo9WXJrtNoGr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fri, Dec 30, 2011 at 12:49:18PM +0300, Mike Telahun Makonnen wrote: > IIRC it's used in NetBSD as a fallback for very slow machines, on > which forking a large number of processes, would delay start up too > long. It exists in FreeBSD because at the time rc.d was introduced > into FreeBSD we tried not to diverge from NetBSD too much. The idea > was that a script from a NetBSD machine should be able to run on a > FreeBSD machine and vice versa. However, that has been (mostly) > abandoned now and over the past few years most of the NetBSD > compatibility shims have been removed. I don't know if anyone uses > this feature on FreeBSD (embedded systems maybe?). OK, thanks for clarification. I think that the request to the -current@, -stable@ and -embedded@ asking for any users of the rc_fast_and_loose will give a better overview of its current users. I'll post the question to these lists. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --sxUMTo9WXJrtNoGr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EAREIAAYFAk8NJNYACgkQFq+eroFS7PvxegD/QCVT3nxgjL3WVj/6iISE5MI+ D+Q/IcGQDGuhUOs8hFMA/2YbE+B2D1kkIySrT1lHtNRwz91WRAnVQX6kkzO/DV9i =Sh7G -----END PGP SIGNATURE----- --sxUMTo9WXJrtNoGr-- From owner-freebsd-rc@FreeBSD.ORG Wed Jan 11 17:16:43 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3B6D106566C for ; Wed, 11 Jan 2012 17:16:42 +0000 (UTC) (envelope-from nvass@gmx.com) Received: from mailout-eu.gmx.com (mailout-eu.gmx.com [213.165.64.42]) by mx1.freebsd.org (Postfix) with SMTP id 4698C8FC0C for ; Wed, 11 Jan 2012 17:16:42 +0000 (UTC) Received: (qmail invoked by alias); 11 Jan 2012 17:13:51 -0000 Received: from adsl-99.109.242.37.tellas.gr (EHLO [192.168.73.194]) [109.242.37.99] by mail.gmx.com (mp-eu002) with SMTP; 11 Jan 2012 18:13:51 +0100 X-Authenticated: #46156728 X-Provags-ID: V01U2FsdGVkX1/A8IcHukLAhNusoDSeRmEDco0eKhhu/PimnXvaps TU2QCLhumRDxdT Message-ID: <4F0DC345.5090605@gmx.com> Date: Wed, 11 Jan 2012 19:13:41 +0200 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-rc@freebsd.org Content-Type: multipart/mixed; boundary="------------040204060601080103070008" X-Y-GMX-Trusted: 0 Subject: allscreens extension X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 17:16:43 -0000 This is a multi-part message in MIME format. --------------040204060601080103070008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I am using this small addition to etc/rc.d/syscons. It extends the allscreens functionality with an allscreens_exclude variable which controls the virtual terminals that are excluded from running the allscreens command. I use it mainly to exclude ttyv0 from switching to raster mode while allscreens are set to raster mode. I can file a proper PR if that sounds interesting to the project? Nikos --------------040204060601080103070008 Content-Type: text/plain; name="syscons.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="syscons.diff" Index: syscons =================================================================== RCS file: /home/ncvs/src/etc/rc.d/syscons,v retrieving revision 1.23.2.1 diff -u -r1.23.2.1 syscons --- syscons 23 Sep 2011 00:51:37 -0000 1.23.2.1 +++ syscons 31 Oct 2011 11:15:42 -0000 @@ -250,7 +250,12 @@ if [ -n "${allscreens_flags}" ]; then sc_init echo -n ' allscreens' - for ttyv in /dev/ttyv*; do + if [ -n "$allscreens_exclude" ]; then + ttyvs=`printf '%s\n' /dev/ttyv* | egrep -v "$allscreens_exclude"` + else + ttyvs=/dev/ttyv* + fi + for ttyv in $ttyvs; do vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1 done fi --------------040204060601080103070008-- From owner-freebsd-rc@FreeBSD.ORG Thu Jan 12 08:58:35 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0306F106566B for ; Thu, 12 Jan 2012 08:58:35 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id B4EF58FC0C for ; Thu, 12 Jan 2012 08:58:34 +0000 (UTC) Received: by iazz13 with SMTP id z13so3657193iaz.13 for ; Thu, 12 Jan 2012 00:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=yRz93XrtG3A1WcEJDAo8ST54UCtMR5pPgDdLchL95W0=; b=qb9uk9Llres0MSNXkWXtnoCOWWbaya+04/Hq26QyB6J62UTBYLfNj+9Koep0BwLYsG GQnM+RSaPiY/R9EcXy3RmnFxmW+T/Ao6ePk5PTN/pflK3bsYPkMf9k+AdAiBC8ivtpLw qlLYXuCdPTbpNSsVy316X+HjDPVHPEoJJMU08= Received: by 10.42.246.71 with SMTP id lx7mr2351854icb.54.1326357030186; Thu, 12 Jan 2012 00:30:30 -0800 (PST) Received: from DataIX.net ([99.190.84.17]) by mx.google.com with ESMTPS id x18sm14827402ibi.2.2012.01.12.00.30.26 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Jan 2012 00:30:28 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q0C8UNjf079272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jan 2012 03:30:23 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q0C8UG5r079261; Thu, 12 Jan 2012 03:30:17 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Thu, 12 Jan 2012 03:30:16 -0500 From: Jason Hellenthal To: Nikos Vassiliadis Message-ID: <20120112083016.GA81123@DataIX.net> References: <4F0DC345.5090605@gmx.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <4F0DC345.5090605@gmx.com> Cc: freebsd-rc@freebsd.org Subject: Re: allscreens extension X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 08:58:35 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 11, 2012 at 07:13:41PM +0200, Nikos Vassiliadis wrote: > Hi, >=20 > I am using this small addition to etc/rc.d/syscons. > It extends the allscreens functionality with an > allscreens_exclude variable which controls the virtual > terminals that are excluded from running the allscreens > command. I use it mainly to exclude ttyv0 from switching > to raster mode while allscreens are set to raster mode. >=20 > I can file a proper PR if that sounds interesting to the project? >=20 Personally I would believe a proper fix for this would be to add functional= ity to rc.d to be able to change terminals on a by terminal basis instead o= f adding an exclude to a variable meant to cover 'ALL' screens. vidcontrol_flags_ttyv0=3D"..." I could have swore functionality like this had already existed "not as the = name listed above" but I don't pay much attention to this area as its usual= ly a configure once and forget or don't configure at all since there is no = console (or spoon). --=20 ;s =3D; --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJPDpoYAAoJEJBXh4mJ2FR+xgIH/3CG1uU8EeKq0EoFDjaHcZMr BKlVtb2pNZ0J7x/sOGUWkw/B3eahT2rbyn3mUh4wzjf13eh41Xk9n7xL6L5j/SCJ NK21bTtmawUa+gcnzE6UhGJVMIxuO0+pDSoRznnTDnMC2MTlbUmc3KFGwC2WT8fN QgcbFe4zpx39uu6uRAlPqtIL0QVFmJZBrXXKiXggdpi7jX5bLA6o+TCbz0EBDwgM Eob+pPcPuDJaoBLhf8uBVP8UuXAC78ovg0Z1JbHYHJJHizLkMNFYA2Z/pY4ZhaoL 8gio9xg1QrdXx8xAt40SYyY8WUlif6S8vUqS+jVn9nA7qaym9EOcynpDvmet+mE= =87OG -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-freebsd-rc@FreeBSD.ORG Thu Jan 12 23:58:25 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D91A106564A for ; Thu, 12 Jan 2012 23:58:25 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 20F648FC0C for ; Thu, 12 Jan 2012 23:58:25 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q0CNiOi2041284 for ; Thu, 12 Jan 2012 15:44:24 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.4/Submit) id q0CNiOZx041283 for freebsd-rc@freebsd.org; Thu, 12 Jan 2012 15:44:24 -0800 (PST) (envelope-from obrien) Date: Thu, 12 Jan 2012 15:44:24 -0800 From: "David O'Brien" To: freebsd-rc@freebsd.org Message-ID: <20120112234424.GA41056@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 9.99-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Problem with LOGIN and cron X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 23:58:25 -0000 'LOGIN' states: This is a dummy dependency to ensure user services such as xdm, inetd, cron and kerberos are started after everything else, in case the administrator has increased the system security level and wants to delay user logins until the system is (almost) fully operational. So based on that, 'securelevel' should have: +# REQUIRE: sysctl +# BEFORE: LOGIN Otherwise a cronjob could act against securelevel=1+ for a short peroid of time. But after adding that one gets rcorder: Circular dependency on provision `LOGIN' in file `cron'. rcorder: Circular dependency on provision `LOGIN' in file `jail'. As 'cron' has "BEFORE: securelevel". Why should that be the case? This comes from r114735 (Move securelevel further back in the boot order) but failed to state any serneios. Thoughts? 'jail' has "REQUIRE: LOGIN" (r113568) and "BEFORE: securelevel". I see the need for "BEFORE: securelevel", but why the need for "REQUIRE: LOGIN"? -- -- David (obrien@FreeBSD.org) P.S. Does this change in ordering look OK? --- /tmp/1 2012-01-12 15:40:27.000000000 -0800 +++ /tmp/2 2012-01-12 15:40:33.000000000 -0800 @@ -126,14 +126,13 @@ sdpd rfcomm_pppd_server rtadvd rwho +jail +localpkg +securelevel LOGIN syscons sshd sendmail -cron -jail -localpkg -securelevel power_profile othermta nfscbd @@ -148,6 +147,7 @@ geli2 ftpd ftp-proxy dhclient +cron bsnmpd bluetooth bgfsck From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 07:11:33 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D1801065673 for ; Fri, 13 Jan 2012 07:11:33 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id ED0AE8FC12 for ; Fri, 13 Jan 2012 07:11:32 +0000 (UTC) Received: by mail-iy0-f182.google.com with SMTP id z13so5879151iaz.13 for ; Thu, 12 Jan 2012 23:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=w7xXHMPmuzaefRKqEqEEkMtLCuN7/9cAbJUz9yVUHI4=; b=mcb1FumMXzbDQEdOUxTHGDD8LEgH3RRzjS2vioXfq4l3rDX6rpQDLHdYJMgNbmS4Gx RIHabGHnqSkK2X62camR4KmTchS68Z0i5s8q734JktnDZP5dpJ3VExVmsAgNrLkJhhuX QiZCSoIlwF3H0StlECIFQv7vd+gCqMmh4PUqk= Received: by 10.42.246.71 with SMTP id lx7mr1461975icb.54.1326438692383; Thu, 12 Jan 2012 23:11:32 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.207.7 with HTTP; Thu, 12 Jan 2012 23:11:01 -0800 (PST) In-Reply-To: <20120112234424.GA41056@dragon.NUXI.org> References: <20120112234424.GA41056@dragon.NUXI.org> From: Chris Rees Date: Fri, 13 Jan 2012 07:11:01 +0000 X-Google-Sender-Auth: 4L7lM1NRcioXq_C2leG8R2HvvK0 Message-ID: To: obrien@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-rc@freebsd.org Subject: Re: Problem with LOGIN and cron X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 07:11:33 -0000 On 12 January 2012 23:44, David O'Brien wrote: > 'LOGIN' states: > =A0 =A0 =A0 =A0This is a dummy dependency to ensure user services such as= xdm, > =A0 =A0 =A0 =A0inetd, cron and kerberos are started after everything else= , in > =A0 =A0 =A0 =A0case the administrator has increased the system security l= evel > =A0 =A0 =A0 =A0and wants to delay user logins until the system is (almost= ) fully > =A0 =A0 =A0 =A0operational. > > So based on that, 'securelevel' should have: > +# REQUIRE: sysctl > +# BEFORE: =A0LOGIN > Otherwise a cronjob could act against securelevel=3D1+ for a short peroid > of time. Hm, but what if I have an @reboot line in crontab, that relies on securelevel <1? Can't we change the wording in the docs instead? Chris From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 09:57:12 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 1ED1B106564A; Fri, 13 Jan 2012 09:57:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 8586715026F; Fri, 13 Jan 2012 09:57:11 +0000 (UTC) Message-ID: <4F0FFFF7.4090105@FreeBSD.org> Date: Fri, 13 Jan 2012 01:57:11 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Hiroki Sato References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> In-Reply-To: <20120109.223510.1979757999064039809.hrs@allbsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 09:57:12 -0000 On 01/09/2012 05:35, Hiroki Sato wrote: > I prefer to use ${name}_enable because putting the same keyword in > two places always leads to a stupid typo issue. So, here's the thing. I understand what you're saying, I really do. The problem is, you're still wrong. :) There are MANY places where you have to use the value of $name literally already, and typos count in every single one of them: 1. The name of the script file 2. PROVIDE 3. REQUIRE 4. names of service-specific methods, e.g.: start_precmd="foo_prestart" 5. Default values in /etc/defaults/rc.conf 6. rc.conf.5 And that's just off the top of my head. The ideal of being able to copy/paste example rc.d scripts for use with new services without having to change [m]any code sounds great in theory. In practice, search and replace is an absolute necessity. So having one more place where you have to replace the name of the old service with the new one isn't going to hurt anything. I haven't seen any objection to the _substance_ of my proposal, so I'm going to go ahead with it tomorrow. Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 10:18:04 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 2D0AD1065670; Fri, 13 Jan 2012 10:18:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id F377814DA06; Fri, 13 Jan 2012 10:18:03 +0000 (UTC) Message-ID: <4F1004DB.2030102@FreeBSD.org> Date: Fri, 13 Jan 2012 02:18:03 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: obrien@freebsd.org References: <20120112234424.GA41056@dragon.NUXI.org> In-Reply-To: <20120112234424.GA41056@dragon.NUXI.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------070301080102090707080508" Cc: freebsd-rc@freebsd.org Subject: Re: Problem with LOGIN and cron X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 10:18:04 -0000 This is a multi-part message in MIME format. --------------070301080102090707080508 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/12/2012 15:44, David O'Brien wrote: > 'LOGIN' states: > This is a dummy dependency to ensure user services such as xdm, > inetd, cron and kerberos are started after everything else, in > case the administrator has increased the system security level > and wants to delay user logins until the system is (almost) fully > operational. > > So based on that, 'securelevel' should have: > +# REQUIRE: sysctl > +# BEFORE: LOGIN I haven't fully processed the implications to your proposed change to rcorder, but a quick meta-note. We should not introduce any new examples of BEFORE in base rc.d scripts. That knob is useful for ports/local stuff, but it makes debugging harder. > Otherwise a cronjob could act against securelevel=1+ for a short peroid > of time. The right way to do what you're proposing is to have LOGIN REQUIRE securelevel. I tend to agree that the current order is sub-optimal. > But after adding that one gets > rcorder: Circular dependency on provision `LOGIN' in file `cron'. > rcorder: Circular dependency on provision `LOGIN' in file `jail'. > > As 'cron' has "BEFORE: securelevel". Why should that be the case? > This comes from r114735 (Move securelevel further back in the boot order) > but failed to state any serneios. > > Thoughts? It sounds like the change to cron's rcorder was an unintended side effect. The attached patch works without any circular dep errors. It produces the following: It moves cron and jail from right before LOGIN, to fairly late after it. There are no other changes. On my system specifically: /etc/rc.d/LOGIN /etc/rc.d/ypxfrd /etc/rc.d/ypupdated /etc/rc.d/watchdogd /etc/rc.d/ubthidhci /etc/rc.d/syscons /etc/rc.d/sshd /etc/rc.d/sendmail /etc/rc.d/othermta /etc/rc.d/nfscbd /etc/rc.d/msgs /etc/rc.d/moused /etc/rc.d/mixer /etc/rc.d/jail *** /etc/rc.d/inetd /etc/rc.d/hostapd /etc/rc.d/gptboot /etc/rc.d/geli2 /etc/rc.d/ftpd /etc/rc.d/ftp-proxy /etc/rc.d/cron *** /etc/rc.d/bsnmpd /etc/rc.d/bgfsck /etc/rc.d/addswap I'm willing to listen to good arguments that describe why cron or jail should start before LOGIN, but if that's going to be the case then yes, we need to update that comment. Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------070301080102090707080508 Content-Type: text/plain; name="rc.d-securelevel.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc.d-securelevel.diff" diff -ur /usr/src/etc/rc.d/LOGIN ./LOGIN --- /usr/src/etc/rc.d/LOGIN 2012-01-08 14:34:00.000000000 -0800 +++ ./LOGIN 2012-01-13 02:06:23.000000000 -0800 @@ -4,7 +4,7 @@ # # PROVIDE: LOGIN -# REQUIRE: DAEMON +# REQUIRE: DAEMON securelevel # This is a dummy dependency to ensure user services such as xdm, # inetd, cron and kerberos are started after everything else, in case diff -ur /usr/src/etc/rc.d/cron ./cron --- /usr/src/etc/rc.d/cron 2012-01-08 14:34:01.000000000 -0800 +++ ./cron 2012-01-13 02:08:04.000000000 -0800 @@ -5,7 +5,6 @@ # PROVIDE: cron # REQUIRE: LOGIN cleanvar -# BEFORE: securelevel # KEYWORD: shutdown . /etc/rc.subr diff -ur /usr/src/etc/rc.d/jail ./jail --- /usr/src/etc/rc.d/jail 2012-01-08 14:34:01.000000000 -0800 +++ ./jail 2012-01-13 02:08:29.000000000 -0800 @@ -5,7 +5,6 @@ # PROVIDE: jail # REQUIRE: LOGIN cleanvar -# BEFORE: securelevel # KEYWORD: nojail shutdown # WARNING: This script deals with untrusted data (the data and diff -ur /usr/src/etc/rc.d/securelevel ./securelevel --- /usr/src/etc/rc.d/securelevel 2012-01-08 14:34:01.000000000 -0800 +++ ./securelevel 2012-01-13 02:07:09.000000000 -0800 @@ -2,8 +2,8 @@ # # $FreeBSD: head/etc/rc.d/securelevel 220153 2011-03-30 01:19:00Z emaste $ # - # PROVIDE: securelevel +# REQUIRE: DAEMON . /etc/rc.subr --------------070301080102090707080508-- From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 14:12:11 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54008106564A; Fri, 13 Jan 2012 14:12:11 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id F37268FC14; Fri, 13 Jan 2012 14:12:10 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 88EAB9AA; Fri, 13 Jan 2012 15:12:08 +0100 (CET) Date: Fri, 13 Jan 2012 15:11:00 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20120113141058.GE1662@garage.freebsd.pl> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8JPrznbw0YAQ/KXy" Content-Disposition: inline In-Reply-To: <4F0FFFF7.4090105@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Hiroki Sato , freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 14:12:11 -0000 --8JPrznbw0YAQ/KXy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 13, 2012 at 01:57:11AM -0800, Doug Barton wrote: > On 01/09/2012 05:35, Hiroki Sato wrote: > > I prefer to use ${name}_enable because putting the same keyword in > > two places always leads to a stupid typo issue. >=20 > So, here's the thing. I understand what you're saying, I really do. The > problem is, you're still wrong. :) >=20 > There are MANY places where you have to use the value of $name literally > already, and typos count in every single one of them: >=20 > 1. The name of the script file > 2. PROVIDE > 3. REQUIRE > 4. names of service-specific methods, e.g.: start_precmd=3D"foo_prestart" > 5. Default values in /etc/defaults/rc.conf > 6. rc.conf.5 >=20 > And that's just off the top of my head. The ideal of being able to > copy/paste example rc.d scripts for use with new services without having > to change [m]any code sounds great in theory. In practice, search and > replace is an absolute necessity. So having one more place where you > have to replace the name of the old service with the new one isn't going > to hurt anything. But if we can avoid it, why not? You gave no argument (valid one) why using variables is wrose than hardcoding names everywhere. > I haven't seen any objection to the _substance_ of my proposal, so I'm > going to go ahead with it tomorrow. Please don't. Touching so many rc.d files is PITA during mergemaster. If we want to do that, let's do that once. The current consensus as I see it, is that you are the only one wanting to hardcode names and there are many in favour of using variables. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --8JPrznbw0YAQ/KXy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8QO3IACgkQForvXbEpPzRn2gCg7G4TwPIQOsa3vzAeJ/c+90XV 9a4AoID/05u528Rd5GJmPDzmTdxdD1mG =/4TM -----END PGP SIGNATURE----- --8JPrznbw0YAQ/KXy-- From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 15:15:35 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FB78106567D for ; Fri, 13 Jan 2012 15:15:35 +0000 (UTC) (envelope-from nvass@gmx.com) Received: from mailout-eu.gmx.com (mailout-eu.gmx.com [213.165.64.42]) by mx1.freebsd.org (Postfix) with SMTP id B67D48FC1D for ; Fri, 13 Jan 2012 15:15:34 +0000 (UTC) Received: (qmail invoked by alias); 13 Jan 2012 15:15:33 -0000 Received: from adsl-99.109.242.37.tellas.gr (EHLO [192.168.73.194]) [109.242.37.99] by mail.gmx.com (mp-eu002) with SMTP; 13 Jan 2012 16:15:33 +0100 X-Authenticated: #46156728 X-Provags-ID: V01U2FsdGVkX18Py3pOOE8Pb8VAqgyeFnKV8wmNWcSDcxD1rxFtvV RsjjkVDt7gm4bm Message-ID: <4F104A88.90902@gmx.com> Date: Fri, 13 Jan 2012 17:15:20 +0200 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jason Hellenthal References: <4F0DC345.5090605@gmx.com> <20120112083016.GA81123@DataIX.net> In-Reply-To: <20120112083016.GA81123@DataIX.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Cc: freebsd-rc@freebsd.org Subject: Re: allscreens extension X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 15:15:35 -0000 On 1/12/2012 10:30 AM, Jason Hellenthal wrote: > > > On Wed, Jan 11, 2012 at 07:13:41PM +0200, Nikos Vassiliadis wrote: >> Hi, >> >> I am using this small addition to etc/rc.d/syscons. >> It extends the allscreens functionality with an >> allscreens_exclude variable which controls the virtual >> terminals that are excluded from running the allscreens >> command. I use it mainly to exclude ttyv0 from switching >> to raster mode while allscreens are set to raster mode. >> >> I can file a proper PR if that sounds interesting to the project? >> > > Personally I would believe a proper fix for this would be to add functionality to rc.d to be able to change terminals on a by terminal basis instead of adding an exclude to a variable meant to cover 'ALL' screens. > > vidcontrol_flags_ttyv0="..." This is probably better and consistent with the rest of the system, but way verbose for my taste. From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 16:41:33 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5BAD106564A; Fri, 13 Jan 2012 16:41:33 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 307D68FC1A; Fri, 13 Jan 2012 16:41:33 +0000 (UTC) Received: by ggki1 with SMTP id i1so2266064ggk.13 for ; Fri, 13 Jan 2012 08:41:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LFpM0hdMTZ0ST+sQMAufY/mHwtbIyG6soK4G2v9+Css=; b=TpBpFnTqHCxoTWrH4jdquLhoRmMKQz/GhdKev9y8U3afiHwwi2Y4oai72LqtExoZvN Jp6+WyqRLjPVCJl5vIh1uliKS97ly95qqAziowqzvuWv6T0FSB8ymU4TnZGZGZMHo4OQ C8UiXqnI7zi6kMYP9ny48Ny9ybxAl0UVtcGdo= MIME-Version: 1.0 Received: by 10.50.76.225 with SMTP id n1mr1485485igw.11.1326472892655; Fri, 13 Jan 2012 08:41:32 -0800 (PST) Received: by 10.231.207.7 with HTTP; Fri, 13 Jan 2012 08:41:32 -0800 (PST) Received: by 10.231.207.7 with HTTP; Fri, 13 Jan 2012 08:41:32 -0800 (PST) In-Reply-To: <20120113141058.GE1662@garage.freebsd.pl> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> Date: Fri, 13 Jan 2012 16:41:32 +0000 Message-ID: From: Chris Rees To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-rc@freebsd.org, Doug Barton Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 16:41:34 -0000 On 13 Jan 2012 14:12, "Pawel Jakub Dawidek" wrote: > > On Fri, Jan 13, 2012 at 01:57:11AM -0800, Doug Barton wrote: > > On 01/09/2012 05:35, Hiroki Sato wrote: > > > I prefer to use ${name}_enable because putting the same keyword in > > > two places always leads to a stupid typo issue. > > > > So, here's the thing. I understand what you're saying, I really do. The > > problem is, you're still wrong. :) > > > > There are MANY places where you have to use the value of $name literally > > already, and typos count in every single one of them: > > > > 1. The name of the script file > > 2. PROVIDE > > 3. REQUIRE > > 4. names of service-specific methods, e.g.: start_precmd="foo_prestart" > > 5. Default values in /etc/defaults/rc.conf > > 6. rc.conf.5 > > > > And that's just off the top of my head. The ideal of being able to > > copy/paste example rc.d scripts for use with new services without having > > to change [m]any code sounds great in theory. In practice, search and > > replace is an absolute necessity. So having one more place where you > > have to replace the name of the old service with the new one isn't going > > to hurt anything. > > But if we can avoid it, why not? You gave no argument (valid one) why > using variables is wrose than hardcoding names everywhere. > > > I haven't seen any objection to the _substance_ of my proposal, so I'm > > going to go ahead with it tomorrow. > > Please don't. Touching so many rc.d files is PITA during mergemaster. > If we want to do that, let's do that once. The current consensus as I > see it, is that you are the only one wanting to hardcode names and there > are many in favour of using variables. > Well.... hardcoding IS faster. Chris From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 17:14:06 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75C181065677; Fri, 13 Jan 2012 17:14:06 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 214558FC0A; Fri, 13 Jan 2012 17:14:06 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4DB9DA89; Fri, 13 Jan 2012 18:14:04 +0100 (CET) Date: Fri, 13 Jan 2012 18:12:56 +0100 From: Pawel Jakub Dawidek To: Chris Rees Message-ID: <20120113171255.GA1694@garage.freebsd.pl> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-rc@freebsd.org, Doug Barton Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 17:14:06 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 13, 2012 at 04:41:32PM +0000, Chris Rees wrote: > On 13 Jan 2012 14:12, "Pawel Jakub Dawidek" wrote: > > Please don't. Touching so many rc.d files is PITA during mergemaster. > > If we want to do that, let's do that once. The current consensus as I > > see it, is that you are the only one wanting to hardcode names and there > > are many in favour of using variables. > > >=20 > Well.... hardcoding IS faster. Can you prove it with ministat(1)? What difference are we talking about? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8QZhcACgkQForvXbEpPzR6ugCg6gkX9zIwuv25jjt+OFZREMQv 3FIAnicNRGWHdC4DmZR88CqN2+7pD0X4 =c4c0 -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR-- From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 18:20:22 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85AAB106564A; Fri, 13 Jan 2012 18:20:22 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id CCB748FC08; Fri, 13 Jan 2012 18:20:21 +0000 (UTC) Received: by ggki1 with SMTP id i1so2371259ggk.13 for ; Fri, 13 Jan 2012 10:20:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=dsBSGlibBokeDbJrJEhdu7jswZVIqExvCrOy7uBtgbQ=; b=QaJoTRPROyahUUamIBtOgZFZk4G74VVwTHV651B2RNGsY+FeN6AvDBiU3+EPlnkqVR 9y71BhjCY7OtRh3PZwt/PkKFS+pALen/rTRQT3AbG5abnh4YObsm7uxKHEQlSbCNJ4tQ DJKCb2quwqi5r4rVpqSHujC9/p5QsRXMBvPKk= Received: by 10.50.46.196 with SMTP id x4mr1802635igm.15.1326478821316; Fri, 13 Jan 2012 10:20:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.207.7 with HTTP; Fri, 13 Jan 2012 10:19:49 -0800 (PST) In-Reply-To: <20120113171255.GA1694@garage.freebsd.pl> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> <20120113171255.GA1694@garage.freebsd.pl> From: Chris Rees Date: Fri, 13 Jan 2012 18:19:49 +0000 Message-ID: To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-rc@freebsd.org, Doug Barton Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:20:22 -0000 On 13 Jan 2012 17:14, "Pawel Jakub Dawidek" wrote: > > On Fri, Jan 13, 2012 at 04:41:32PM +0000, Chris Rees wrote: > > On 13 Jan 2012 14:12, "Pawel Jakub Dawidek" wrote: > > > Please don't. Touching so many rc.d files is PITA during mergemaster. > > > If we want to do that, let's do that once. The current consensus as I > > > see it, is that you are the only one wanting to hardcode names and th= ere > > > are many in favour of using variables. > > > > > > > Well.... hardcoding IS faster. > > Can you prove it with ministat(1)? What difference are we talking about? > I sense I'm about to get ripped a new one... Obviously dereferencing a variable has a cost.=A0 Normally, no big deal, but I'm happy to research it later. These scripts are run through a huge number of times at various stages, and any slowdown is detrimental. Also, I tend to agree with Doug on the <> issue. If we really want to reuse code like that then we need to start using m4 or something (I'm only being half facetious here). Code reuse is great, but that's not really the case here. Chris From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 18:44:28 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 458971065673; Fri, 13 Jan 2012 18:44:28 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E6F778FC19; Fri, 13 Jan 2012 18:44:27 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id q0DIeEVV053066 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 13 Jan 2012 11:40:17 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Fri, 13 Jan 2012 11:40:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <35B3C9CE-0D58-4DDC-AE6D-A6EF450DF39D@bsdimp.com> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> <20120113171255.GA1694@garage.freebsd.pl> To: Chris Rees X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 13 Jan 2012 11:40:17 -0700 (MST) Cc: freebsd-rc@freebsd.org, Doug Barton , Pawel Jakub Dawidek Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:44:28 -0000 On Jan 13, 2012, at 11:19 AM, Chris Rees wrote: > Also, I tend to agree with Doug on the <> issue. > If we really want to reuse code like that then we need to start using > m4 or something (I'm only being half facetious here). Well, nothing is keeping us from having foo.m4 as our source and = compiling it into foo... Except maybe the fact that m4 makes my eyeballs bleed (I did do my = resume with m4 none-the-less :) Warner From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 18:58:53 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5714F1065688; Fri, 13 Jan 2012 18:58:53 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C16848FC1E; Fri, 13 Jan 2012 18:58:52 +0000 (UTC) Received: by obbta17 with SMTP id ta17so3927906obb.13 for ; Fri, 13 Jan 2012 10:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=roaIdSZnHkMloDskezI3iaC16M5I3R05Sheq5jZcyG8=; b=Uxp255Ktv8VKUE1RF1bJeITZjkpnbIoRpmAOYjCCMgrDNKsxBn198XE5owyKrTXGqf dTIkw8v/Pyr50laUuIdIdHiR7pwGPn9VoEYKhtDYTZWgEB6+yHEnTxZRkEBJTH96d5SC HFcKeo7QBtQn0ZZIC4Xsg4tzNwXUh3S7AFCB0= Received: by 10.50.161.135 with SMTP id xs7mr942161igb.15.1326481132265; Fri, 13 Jan 2012 10:58:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.207.7 with HTTP; Fri, 13 Jan 2012 10:58:21 -0800 (PST) In-Reply-To: <35B3C9CE-0D58-4DDC-AE6D-A6EF450DF39D@bsdimp.com> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> <20120113171255.GA1694@garage.freebsd.pl> <35B3C9CE-0D58-4DDC-AE6D-A6EF450DF39D@bsdimp.com> From: Chris Rees Date: Fri, 13 Jan 2012 18:58:21 +0000 Message-ID: To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-rc@freebsd.org, Doug Barton , Pawel Jakub Dawidek Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:58:53 -0000 On 13 January 2012 18:40, Warner Losh wrote: > > On Jan 13, 2012, at 11:19 AM, Chris Rees wrote: >> Also, I tend to agree with Doug on the <> issue. >> If we really want to reuse code like that then we need to start using >> m4 or something (I'm only being half facetious here). > > Well, nothing is keeping us from having foo.m4 as our source and compiling it into foo... > > Except maybe the fact that m4 makes my eyeballs bleed (I did do my resume with m4 none-the-less :) That was my point. It'd require loads less boilerplate.... Chris From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 19:28:11 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80BDD1065670; Fri, 13 Jan 2012 19:28:11 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 282A38FC0A; Fri, 13 Jan 2012 19:28:11 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q0DJSAF7087368; Fri, 13 Jan 2012 11:28:10 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.4/Submit) id q0DJSAO0087367; Fri, 13 Jan 2012 11:28:10 -0800 (PST) (envelope-from obrien) Date: Fri, 13 Jan 2012 11:28:10 -0800 From: "David O'Brien" To: Chris Rees Message-ID: <20120113192810.GA87287@dragon.NUXI.org> References: <20120112234424.GA41056@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 9.99-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-rc@freebsd.org Subject: Re: Problem with LOGIN and cron X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:28:11 -0000 On Fri, Jan 13, 2012 at 07:11:01AM +0000, Chris Rees wrote: > On 12 January 2012 23:44, David O'Brien wrote: > > 'LOGIN' states: > >        This is a dummy dependency to ensure user services such as xdm, > >        inetd, cron and kerberos are started after everything else, in > >        case the administrator has increased the system security level > >        and wants to delay user logins until the system is (almost) fully > >        operational. > > > > So based on that, 'securelevel' should have: > > +# REQUIRE: sysctl > > +# BEFORE:  LOGIN > > Otherwise a cronjob could act against securelevel=1+ for a short peroid > > of time. > > Hm, but what if I have an @reboot line in crontab, that relies on > securelevel <1? Can you give an example? $ man cron | grep @reboot {empty} $ man crontab | grep @reboot {empty} > Can't we change the wording in the docs instead? We could, but that would sweep what I feel may be a security issue under the rug. -- -- David (obrien@FreeBSD.org) From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 19:32:46 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F03DC1065676 for ; Fri, 13 Jan 2012 19:32:46 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id CEC5A8FC1E for ; Fri, 13 Jan 2012 19:32:46 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.5/8.14.5) with ESMTP id q0DJWkSq087427; Fri, 13 Jan 2012 11:32:46 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.5/8.14.4/Submit) id q0DJWkoe087426; Fri, 13 Jan 2012 11:32:46 -0800 (PST) (envelope-from obrien) Date: Fri, 13 Jan 2012 11:32:46 -0800 From: "David O'Brien" To: Doug Barton Message-ID: <20120113193246.GB87287@dragon.NUXI.org> References: <20120112234424.GA41056@dragon.NUXI.org> <4F1004DB.2030102@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F1004DB.2030102@FreeBSD.org> X-Operating-System: FreeBSD 9.99-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-rc@FreeBSD.org Subject: Re: Problem with LOGIN and cron X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:32:47 -0000 On Fri, Jan 13, 2012 at 02:18:03AM -0800, Doug Barton wrote: > I haven't fully processed the implications to your proposed change to > rcorder, but a quick meta-note. We should not introduce any new > examples of BEFORE in base rc.d scripts. That knob is useful for > ports/local stuff, but it makes debugging harder. Doug, Thanks for the info. I need to digest the BEFORE vs. LOGIN REQUIRE it a little bit more with my local patch. > It moves cron and jail from right before LOGIN, to fairly late after it. > There are no other changes. On my system specifically: With my change, jail was pushed earlier, not later. I'm pretty sure jail should run before changes the secure level -- especially if one wants securelevel=3. I have no opinion on cron running later than it did before. -- -- David (obrien@FreeBSD.org) From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 19:53:58 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EF661065672; Fri, 13 Jan 2012 19:53:58 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3291F8FC08; Fri, 13 Jan 2012 19:53:58 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 3ED41B3A; Fri, 13 Jan 2012 20:53:56 +0100 (CET) Date: Fri, 13 Jan 2012 20:52:48 +0100 From: Pawel Jakub Dawidek To: David O'Brien Message-ID: <20120113195245.GE1694@garage.freebsd.pl> References: <20120112234424.GA41056@dragon.NUXI.org> <20120113192810.GA87287@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZRyEpB+iJ+qUx0kp" Content-Disposition: inline In-Reply-To: <20120113192810.GA87287@dragon.NUXI.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-rc@freebsd.org Subject: Re: Problem with LOGIN and cron X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:53:58 -0000 --ZRyEpB+iJ+qUx0kp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 13, 2012 at 11:28:10AM -0800, David O'Brien wrote: > On Fri, Jan 13, 2012 at 07:11:01AM +0000, Chris Rees wrote: > > On 12 January 2012 23:44, David O'Brien wrote: > > > 'LOGIN' states: > > > =A0 =A0 =A0 =A0This is a dummy dependency to ensure user services suc= h as xdm, > > > =A0 =A0 =A0 =A0inetd, cron and kerberos are started after everything = else, in > > > =A0 =A0 =A0 =A0case the administrator has increased the system securi= ty level > > > =A0 =A0 =A0 =A0and wants to delay user logins until the system is (al= most) fully > > > =A0 =A0 =A0 =A0operational. > > > > > > So based on that, 'securelevel' should have: > > > +# REQUIRE: sysctl > > > +# BEFORE: =A0LOGIN > > > Otherwise a cronjob could act against securelevel=3D1+ for a short pe= roid > > > of time. > >=20 > > Hm, but what if I have an @reboot line in crontab, that relies on > > securelevel <1? >=20 > Can you give an example? >=20 > $ man cron | grep @reboot > {empty} > $ man crontab | grep @reboot > {empty} $ man 5 crontab | grep @reboot @reboot Run once, at startup. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --ZRyEpB+iJ+qUx0kp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8Qi40ACgkQForvXbEpPzROgQCfX7E9VS2mXdTMZ4pMpqbsvdGc pG4AoN6PsF2Gb/zJBhlVouyQTCNrozd0 =xzL4 -----END PGP SIGNATURE----- --ZRyEpB+iJ+qUx0kp-- From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 22:48:27 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 824B8106564A; Fri, 13 Jan 2012 22:48:27 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 42C0014F01C; Fri, 13 Jan 2012 22:48:26 +0000 (UTC) Message-ID: <4F10B4B9.90207@FreeBSD.org> Date: Fri, 13 Jan 2012 14:48:25 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> In-Reply-To: <20120113141058.GE1662@garage.freebsd.pl> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Hiroki Sato , freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 22:48:27 -0000 On 01/13/2012 06:11, Pawel Jakub Dawidek wrote: > Touching so many rc.d files is PITA during mergemaster. rm -r /etc/rc.d/* && mergemaster -i -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Fri Jan 13 23:24:17 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA84E106566C; Fri, 13 Jan 2012 23:24:17 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 859248FC15; Fri, 13 Jan 2012 23:24:17 +0000 (UTC) Received: by iagz16 with SMTP id z16so335684iag.13 for ; Fri, 13 Jan 2012 15:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=v8dc0u1Y/KPhnewz/92xp+arokmbzP5FLske70McJ28=; b=Xq1mqe0OJ7x0fSz8Tnd8mLO8uc2we24bpqNuFpcJLu5Y4dQGgO97ySHgP24oTE6Yty qXAqQz+mh7V8vKygTBzp09nypFPBmQr0MmGFzcU3ysTX8yHFU9ipd8nAPw5DFKGd1TWg sBBi4ajOOnQHlPKiUqf7at0nKGK4WtaIuT/8s= Received: by 10.42.161.10 with SMTP id r10mr2179078icx.22.1326497057091; Fri, 13 Jan 2012 15:24:17 -0800 (PST) Received: from kruse-40.4.ixsystems.com (drawbridge.ixsystems.com. [206.40.55.65]) by mx.google.com with ESMTPS id py4sm9095973igc.2.2012.01.13.15.24.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jan 2012 15:24:16 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Garrett Cooper In-Reply-To: <4F10B4B9.90207@FreeBSD.org> Date: Fri, 13 Jan 2012 15:24:22 -0800 Content-Transfer-Encoding: 7bit Message-Id: <091ED985-FE1E-4172-9E65-807E8E518496@gmail.com> References: <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> <4F10B4B9.90207@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1251.1) Cc: freebsd-rc@FreeBSD.org, Hiroki Sato , Pawel Jakub Dawidek Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 23:24:18 -0000 On Jan 13, 2012, at 2:48 PM, Doug Barton wrote: > On 01/13/2012 06:11, Pawel Jakub Dawidek wrote: >> Touching so many rc.d files is PITA during mergemaster. > > rm -r /etc/rc.d/* && mergemaster -i >.<. mergemaster -iU ? -Garrett From owner-freebsd-rc@FreeBSD.ORG Sat Jan 14 00:39:30 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2115106564A; Sat, 14 Jan 2012 00:39:30 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id EB3918FC0C; Sat, 14 Jan 2012 00:39:29 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0E0dEDv011450; Sat, 14 Jan 2012 09:39:24 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0E0dDj5042627; Sat, 14 Jan 2012 09:39:14 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Sat, 14 Jan 2012 09:32:09 +0900 (JST) Message-Id: <20120114.093209.917724318321412912.hrs@allbsd.org> To: dougb@FreeBSD.org From: Hiroki Sato In-Reply-To: <20120113141058.GE1662@garage.freebsd.pl> References: <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3.51 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Sat_Jan_14_09_32_09_2012_446)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Sat, 14 Jan 2012 09:39:27 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: freebsd-rc@FreeBSD.org, pjd@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 00:39:30 -0000 ----Security_Multipart(Sat_Jan_14_09_32_09_2012_446)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Pawel Jakub Dawidek wrote in <20120113141058.GE1662@garage.freebsd.pl>: pj> On Fri, Jan 13, 2012 at 01:57:11AM -0800, Doug Barton wrote: pj> > On 01/09/2012 05:35, Hiroki Sato wrote: pj> > > I prefer to use ${name}_enable because putting the same keyword in pj> > > two places always leads to a stupid typo issue. pj> > pj> > So, here's the thing. I understand what you're saying, I really do. The pj> > problem is, you're still wrong. :) pj> > pj> > There are MANY places where you have to use the value of $name literally pj> > already, and typos count in every single one of them: pj> > pj> > 1. The name of the script file pj> > 2. PROVIDE pj> > 3. REQUIRE pj> > 4. names of service-specific methods, e.g.: start_precmd="foo_prestart" pj> > 5. Default values in /etc/defaults/rc.conf pj> > 6. rc.conf.5 pj> > pj> > And that's just off the top of my head. The ideal of being able to pj> > copy/paste example rc.d scripts for use with new services without having pj> > to change [m]any code sounds great in theory. In practice, search and pj> > replace is an absolute necessity. So having one more place where you pj> > have to replace the name of the old service with the new one isn't going pj> > to hurt anything. pj> pj> But if we can avoid it, why not? You gave no argument (valid one) why pj> using variables is wrose than hardcoding names everywhere. pj> pj> > I haven't seen any objection to the _substance_ of my proposal, so I'm pj> > going to go ahead with it tomorrow. pj> pj> Please don't. Touching so many rc.d files is PITA during mergemaster. pj> If we want to do that, let's do that once. The current consensus as I pj> see it, is that you are the only one wanting to hardcode names and there pj> are many in favour of using variables. And I do not think it is a good idea to commit something related to this topic while the discussion is ongoing. We have reached a consensus that `set_rcvar` is expensive, but for whether using literal or variable we haven't. -- Hiroki ---------------------------- revision 1.1149 date: 2012/01/13 22:52:32; author: dougb; state: Exp; lines: +2 -2 Change rcvar in the example rc.d script to use the literal value ---------------------------- Index: book.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v retrieving revision 1.1148 retrieving revision 1.1149 diff -d -u -I \$FreeBSD:.*\$ -I \$NetBSD:.*\$ -I \$OpenBSD:.*\$ -I \$DragonFly:.*\$ -I \$Id:.*\$ -I \$Translation:.*\$ -I \$hrs:.*\$ -r1.1148 -r1.1149 --- book.sgml 10 Jan 2012 03:32:58 -0000 1.1148 +++ book.sgml 13 Jan 2012 22:52:32 -0000 1.1149 @@ -8956,8 +8956,8 @@ . /etc/rc.subr -name="doormand" -rcvar=${name}_enable +name=doormand +rcvar=doormand_enable load_rc_config $name ----Security_Multipart(Sat_Jan_14_09_32_09_2012_446)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8QzQkACgkQTyzT2CeTzy00dwCglzNykficW39wQRlzDi0Nh6M2 lb0AoIhnJ8EXRV9OPttqUIillegisEoj =L5be -----END PGP SIGNATURE----- ----Security_Multipart(Sat_Jan_14_09_32_09_2012_446)---- From owner-freebsd-rc@FreeBSD.ORG Sat Jan 14 00:49:53 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 6B0CB1065673; Sat, 14 Jan 2012 00:49:53 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id B396D150E42; Sat, 14 Jan 2012 00:49:52 +0000 (UTC) Message-ID: <4F10D130.8080808@FreeBSD.org> Date: Fri, 13 Jan 2012 16:49:52 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Hiroki Sato References: <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> <20120114.093209.917724318321412912.hrs@allbsd.org> In-Reply-To: <20120114.093209.917724318321412912.hrs@allbsd.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org, pjd@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 00:49:53 -0000 On 01/13/2012 16:32, Hiroki Sato wrote: > And I do not think it is a good idea to commit something related to > this topic while the discussion is ongoing. > > We have reached a consensus that `set_rcvar` is expensive, but for > whether using literal or variable we haven't. Quite frankly I'm not interested in the consensus at this point. You and others have brought up several justifications for the way you want to do it, and I've systematically pointed out that they're all wrong. "Consensus" doesn't mean something is right, it just means it's the least objectionable option, which is a terrible way to run a railroad. Chris was right that there is absolutely no question that not having to dereference the variable is faster. How much faster really isn't the point. Every little bit helps, especially on embedded/slower systems. So just relax, stop trying to make this a pissing contest, and focus your attention on something useful, like fixing openbgpd and TCP_SIGNATURE. :) Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Sat Jan 14 01:19:02 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 172CB106566B; Sat, 14 Jan 2012 01:19:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id E3F7C1548BB; Sat, 14 Jan 2012 01:19:00 +0000 (UTC) Message-ID: <4F10D803.5060706@FreeBSD.org> Date: Fri, 13 Jan 2012 17:18:59 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: obrien@FreeBSD.org References: <20120112234424.GA41056@dragon.NUXI.org> <4F1004DB.2030102@FreeBSD.org> <20120113193246.GB87287@dragon.NUXI.org> In-Reply-To: <20120113193246.GB87287@dragon.NUXI.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------090603040807070704090303" Cc: freebsd-rc@FreeBSD.org Subject: Re: Problem with LOGIN and cron X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 01:19:02 -0000 This is a multi-part message in MIME format. --------------090603040807070704090303 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/13/2012 11:32, David O'Brien wrote: > On Fri, Jan 13, 2012 at 02:18:03AM -0800, Doug Barton wrote: >> I haven't fully processed the implications to your proposed change to >> rcorder, but a quick meta-note. We should not introduce any new >> examples of BEFORE in base rc.d scripts. That knob is useful for >> ports/local stuff, but it makes debugging harder. > > Doug, > Thanks for the info. I need to digest the BEFORE vs. LOGIN REQUIRE it a > little bit more with my local patch. > > >> It moves cron and jail from right before LOGIN, to fairly late after it. >> There are no other changes. On my system specifically: > > With my change, jail was pushed earlier, not later. I'm pretty sure > jail should run before changes the secure level -- especially if one > wants securelevel=3. Fair enough, attached patch doesn't change jail but moves cron late like my last patch. Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------090603040807070704090303 Content-Type: text/plain; name="rc.d-securelevel.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc.d-securelevel.diff" diff -ur /usr/src/etc/rc.d/LOGIN ./LOGIN --- /usr/src/etc/rc.d/LOGIN 2012-01-08 14:34:00.000000000 -0800 +++ ./LOGIN 2012-01-13 02:06:23.000000000 -0800 @@ -4,7 +4,7 @@ # # PROVIDE: LOGIN -# REQUIRE: DAEMON +# REQUIRE: DAEMON securelevel # This is a dummy dependency to ensure user services such as xdm, # inetd, cron and kerberos are started after everything else, in case Only in /usr/src/etc/rc.d: Makefile diff -ur /usr/src/etc/rc.d/cron ./cron --- /usr/src/etc/rc.d/cron 2012-01-08 14:34:01.000000000 -0800 +++ ./cron 2012-01-13 02:08:04.000000000 -0800 @@ -5,7 +5,6 @@ # PROVIDE: cron # REQUIRE: LOGIN cleanvar -# BEFORE: securelevel # KEYWORD: shutdown . /etc/rc.subr diff -ur /usr/src/etc/rc.d/jail ./jail --- /usr/src/etc/rc.d/jail 2012-01-08 14:34:01.000000000 -0800 +++ ./jail 2012-01-13 17:09:44.000000000 -0800 @@ -4,8 +4,7 @@ # # PROVIDE: jail -# REQUIRE: LOGIN cleanvar -# BEFORE: securelevel +# REQUIRE: DAEMON cleanvar # KEYWORD: nojail shutdown # WARNING: This script deals with untrusted data (the data and diff -ur /usr/src/etc/rc.d/securelevel ./securelevel --- /usr/src/etc/rc.d/securelevel 2012-01-08 14:34:01.000000000 -0800 +++ ./securelevel 2012-01-13 17:14:55.000000000 -0800 @@ -4,6 +4,7 @@ # # PROVIDE: securelevel +# REQUIRE: DAEMON jail . /etc/rc.subr --------------090603040807070704090303-- From owner-freebsd-rc@FreeBSD.ORG Sat Jan 14 06:25:01 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17802106566C for ; Sat, 14 Jan 2012 06:25:01 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id C8BC98FC12 for ; Sat, 14 Jan 2012 06:25:00 +0000 (UTC) Received: by iagz16 with SMTP id z16so978478iag.13 for ; Fri, 13 Jan 2012 22:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=2NzXuSjfEQkC9Hqb2LJY03nJvyWHeM7+j0CGpE22xaY=; b=pgZJAmZ5VQX1C2dqkUqnxkMDNamWPxo0eoSPQ/Ec7r/l16zhPJE6QXkgSXJjUqhoXF VOTl+6jMV2TnqAonzkbrfPV/LAkq+qHj81EmG1RWr6Impd6gU8YppTTAwcpx8ZyCzNK+ xyE9yBh+BzmX34J1bh7qoeynDrvR93bdsmQHg= Received: by 10.50.188.166 with SMTP id gb6mr3763444igc.18.1326522300433; Fri, 13 Jan 2012 22:25:00 -0800 (PST) Received: from DataIX.net (adsl-99-56-123-248.dsl.klmzmi.sbcglobal.net. [99.56.123.248]) by mx.google.com with ESMTPS id b20sm37359768ibj.7.2012.01.13.22.24.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jan 2012 22:24:59 -0800 (PST) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id q0E6Otd2030904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Jan 2012 01:24:56 -0500 (EST) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id q0E6Oo8w030203; Sat, 14 Jan 2012 01:24:50 -0500 (EST) (envelope-from jhell@DataIX.net) Date: Sat, 14 Jan 2012 01:24:50 -0500 From: Jason Hellenthal To: Nikos Vassiliadis Message-ID: <20120114062450.GA93768@DataIX.net> References: <4F0DC345.5090605@gmx.com> <20120112083016.GA81123@DataIX.net> <4F104A88.90902@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F104A88.90902@gmx.com> Cc: freebsd-rc@freebsd.org Subject: Re: allscreens extension X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 06:25:01 -0000 On Fri, Jan 13, 2012 at 05:15:20PM +0200, Nikos Vassiliadis wrote: > On 1/12/2012 10:30 AM, Jason Hellenthal wrote: > > > > > > On Wed, Jan 11, 2012 at 07:13:41PM +0200, Nikos Vassiliadis wrote: > >> Hi, > >> > >> I am using this small addition to etc/rc.d/syscons. > >> It extends the allscreens functionality with an > >> allscreens_exclude variable which controls the virtual > >> terminals that are excluded from running the allscreens > >> command. I use it mainly to exclude ttyv0 from switching > >> to raster mode while allscreens are set to raster mode. > >> > >> I can file a proper PR if that sounds interesting to the project? > >> > > > > Personally I would believe a proper fix for this would be to add functionality to rc.d to be able to change terminals on a by terminal basis instead of adding an exclude to a variable meant to cover 'ALL' screens. > > > > vidcontrol_flags_ttyv0="..." > > This is probably better and consistent with the rest of the system, > but way verbose for my taste. Agreed. I cant see a real benefit to configuring different console variations on a per-TTY basis. It just does not fall into my usage. Its either configured it its not and using vidcontrol in the same way its used within rc.d/syscons is not hard either. Configuration remote terminals would be ideal where the box does not have a single local TTY allocated. -- ;s =; From owner-freebsd-rc@FreeBSD.ORG Sat Jan 14 16:00:51 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC7FC106566B; Sat, 14 Jan 2012 16:00:51 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3E40D8FC12; Sat, 14 Jan 2012 16:00:51 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 766E2DD3; Sat, 14 Jan 2012 17:00:48 +0100 (CET) Date: Sat, 14 Jan 2012 16:59:37 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20120114155937.GH1694@garage.freebsd.pl> References: <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> <20120114.093209.917724318321412912.hrs@allbsd.org> <4F10D130.8080808@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ewQ5hdP4CtoTt3oD" Content-Disposition: inline In-Reply-To: <4F10D130.8080808@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Hiroki Sato , freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 16:00:52 -0000 --ewQ5hdP4CtoTt3oD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 13, 2012 at 04:49:52PM -0800, Doug Barton wrote: > On 01/13/2012 16:32, Hiroki Sato wrote: > > And I do not think it is a good idea to commit something related to > > this topic while the discussion is ongoing. > >=20 > > We have reached a consensus that `set_rcvar` is expensive, but for > > whether using literal or variable we haven't. >=20 > Quite frankly I'm not interested in the consensus at this point. You and > others have brought up several justifications for the way you want to do > it, and I've systematically pointed out that they're all wrong. > "Consensus" doesn't mean something is right, it just means it's the > least objectionable option, which is a terrible way to run a railroad. >=20 > Chris was right that there is absolutely no question that not having to > dereference the variable is faster. How much faster really isn't the > point. Every little bit helps, especially on embedded/slower systems. So, every little bit helps when it comes to boot time, but every little bit doesn't help when it comes to reusing existing scripts? You only think you pointed out the arguments given are wrong. Because nobody addresses claims like 'it is 31337 to use variables, so don't do that', doesn't mean they are valid, it means they are not even worth addressing. Also, we don't currently use hardcoded names consistently across all rc.d scripts, so this is not about changing current world order. Currently we have total mess and two ways of cleaning it up: one being ${name} usage and the other being hardcoded names. All this means it is not about convincing you that we should move from hardcoded names to variables, but to find convensus which method we should start using as a rule and how to clean up what we currently have. Using your logic, I could as well say that you provided no convincing arguments, so it of course means we are going with ${name} option. It doesn't work like that. To sum up. There is currently only one candidate for a valid argument behind hardcoded names - speed. To make it a valid argument you need to provide a prove, because this claim may be indeed proved. Based on the prove we can either forget about this argument if there is no measurable difference or decide if the slowdown is acceptable (if there is one). Are there any other arguments on the table? For using variable there is an arguments that it will make reusing existing scripts easier and making the code cleaner. Eliminating every hardcoded name does help a bit with script modification and makes the process less prone to human errors, especially because there is no compiler to tell us something went wrong. I'm also not alone in support for this argument. =46rom this summary it is quite clear to me, that if we are going to continue this discussion, proformance claim has to be proved. Without the prove this option is left with no valid arguments. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --ewQ5hdP4CtoTt3oD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8RpmgACgkQForvXbEpPzSlhACeOkApJpDy5iakwkZifc0bp1te pRoAn0vGHPSWHOW7b/BcvtI4FVWMcN8V =qDXq -----END PGP SIGNATURE----- --ewQ5hdP4CtoTt3oD-- From owner-freebsd-rc@FreeBSD.ORG Sat Jan 14 21:08:25 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 9FF9E106566B; Sat, 14 Jan 2012 21:08:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 98E2C151779; Sat, 14 Jan 2012 21:08:23 +0000 (UTC) Message-ID: <4F11EEC7.5070008@FreeBSD.org> Date: Sat, 14 Jan 2012 13:08:23 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org> <20120113141058.GE1662@garage.freebsd.pl> <20120114.093209.917724318321412912.hrs@allbsd.org> <4F10D130.8080808@FreeBSD.org> <20120114155937.GH1694@garage.freebsd.pl> In-Reply-To: <20120114155937.GH1694@garage.freebsd.pl> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Hiroki Sato , freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 21:08:25 -0000 On 01/14/2012 07:59, Pawel Jakub Dawidek wrote: > So, every little bit helps when it comes to boot time, but every little > bit doesn't help when it comes to reusing existing scripts? Um, yeah. You can answer that question for yourself by asking how many times a new rc.d script will be written, vs. how many times it will be called at boot time. You seem very focused on the idea of "consistency." I already pointed out that if that's a primary concern than the right answer is to change all uses of $name to point to the literal value, and I'm happy to do that if people agree that it's a good idea. Otherwise, we should probably move on to other things. Another way to ask the same question, why does the maxim "The one who is willing to do the work gets to determine how the work will be done" apply to everyone in the project except me? :) Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/