From owner-freebsd-rc@FreeBSD.ORG Sun Jul 11 11:52:41 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37B6616A4CE for ; Sun, 11 Jul 2004 11:52:41 +0000 (GMT) Received: from zaphod.nitro.dk (port324.ds1-khk.adsl.cybercity.dk [212.242.113.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DC7C43D45 for ; Sun, 11 Jul 2004 11:52:40 +0000 (GMT) (envelope-from simon@zaphod.nitro.dk) Received: by zaphod.nitro.dk (Postfix, from userid 3000) id 1B85511A00; Sun, 11 Jul 2004 13:52:38 +0200 (CEST) Date: Sun, 11 Jul 2004 13:52:38 +0200 From: "Simon L. Nielsen" To: freebsd-rc@FreeBSD.org Message-ID: <20040711115238.GB753@zaphod.nitro.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ABTtc+pdwF7KHXCz" Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: Enhancement to gbde rc.d script (try 2) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 11 Jul 2004 11:52:41 -0000 --ABTtc+pdwF7KHXCz Content-Type: multipart/mixed; boundary="IiVenqGWf+H9Y6IX" Content-Disposition: inline --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey I posted this patch in January without getting much response so I'm trying again with an updated version which works with recent -CURRENT's. The functionality is the same as the last time... : I have enhanced the gbde rc.d script a bit, so it asks the user X times (normally 3) for the pass-phrase. I have also added support for having the lockfiles in another other directories than /etc. Both features are documented, and the existing feature of specifying the exact filename of a lockfile is also documented in this patch. Could someone commit or approve this ? Thanks. --=20 Simon L. Nielsen FreeBSD Documentation Team --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gbde-rc.d.2.patch" Content-Transfer-Encoding: quoted-printable Index: etc/rc.d/gbde =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 RCS file: /home/ncvs/src/etc/rc.d/gbde,v retrieving revision 1.4 diff -u -d -r1.4 gbde --- etc/rc.d/gbde 8 Mar 2004 12:25:05 -0000 1.4 +++ etc/rc.d/gbde 11 Jul 2004 10:41:40 -0000 @@ -81,10 +81,20 @@ for device in $gbde_devices; do parentdev=3D${device%.bde} parent=3D${parentdev#/dev/} - eval "lock=3D\${gbde_lock_${parent}-\"/etc/${parent}.lock\"}" - if [ -e $lock ]; then + eval "lock=3D\${gbde_lock_${parent}-\"${gbde_lockdir}/${parent}.lock\"}" + if [ -e "${lock}" -a ! -e "${device}" ]; then echo "Configuring Disk Encryption for ${device}." - gbde attach ${parentdev} -l ${lock} + + count=3D1 + while [ ${count} -le ${gbde_attach_attempts} ]; do + gbde attach ${parentdev} -l ${lock} + if [ -e ${device} ]; then + break + fi + echo "Attach failed; attempt ${count} of ${gbde_attach_attempts}." + count=3D$((${count} + 1)) + done + fi done } Index: etc/defaults/rc.conf =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 RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.210 diff -u -d -r1.210 rc.conf --- etc/defaults/rc.conf 30 Jun 2004 15:58:46 -0000 1.210 +++ etc/defaults/rc.conf 3 Jul 2004 11:00:23 -0000 @@ -50,6 +50,8 @@ # Experimental - test before enabling gbde_autoattach_all=3D"NO" # YES automatically mounts gbde devices from fs= tab gbde_devices=3D"NO" # Devices to automatically attach (list, or AUTO) +gbde_attach_attempts=3D"3" # Number of times to attempt attaching gbde dev= ices. +gbde_lockdir=3D"/etc" # Where to look for gbde lockfiles. gbde_swap_enable=3D"NO" # Set to YES to automatically initialize gbde swap # devices listed in fstab with a random one-shot key =20 Index: share/man/man5/rc.conf.5 =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 RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.220 diff -u -d -r1.220 rc.conf.5 --- share/man/man5/rc.conf.5 3 Jul 2004 18:29:23 -0000 1.220 +++ share/man/man5/rc.conf.5 11 Jul 2004 11:44:39 -0000 @@ -1069,6 +1069,31 @@ List the devices that the script should try to attach, or .Dq Li AUTO . +.It Va gbde_lockdir +.Pq Vt str +The directory where the +.Xr gbde 4 +lockfiles are located. +The default lockfile directory is +.Pa /etc . +.Pp +The lockfile for each individual +.Xr gbde 4 +device can be overridden by setting the variable +.Va gbde_lock_ Ns Aq Ar device , +where +.Ar device +is the encrypted device without the +.Dq Pa /dev/ +and +.Dq Pa .bde +parts. +.It Va gbde_attach_attempts +.Pq Vt int +Number of times to attempt attaching to a +.Xr gbde 4 +device, i.e. how many times the user is asked for the pass-phrase. +Default is 3. .It Va gbde_swap_enable .Pq Vt bool If set to --IiVenqGWf+H9Y6IX-- --ABTtc+pdwF7KHXCz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA8SoGh9pcDSc1mlERAvFFAJ9ZpMuO1JwMTseBteEGUf3zQ+CLcgCdFCig KChwp8kQfoEwWiJ6itBu6zw= =90Ea -----END PGP SIGNATURE----- --ABTtc+pdwF7KHXCz-- From owner-freebsd-rc@FreeBSD.ORG Tue Jul 13 14:03:19 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 760CB16A4CE for ; Tue, 13 Jul 2004 14:03:19 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A46A43D1F for ; Tue, 13 Jul 2004 14:03:13 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.148] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 51470779 for freebsd-rc@freebsd.org; Tue, 13 Jul 2004 16:56:27 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6DE3vn0001760 for ; Tue, 13 Jul 2004 17:03:59 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6DE3uLL001759 for freebsd-rc@freebsd.org; Tue, 13 Jul 2004 17:03:56 +0300 (EAT) (envelope-from mtm) Date: Tue, 13 Jul 2004 17:03:54 +0300 From: Mike Makonnen To: freebsd-rc@freebsd.org Message-ID: <20040713140354.GA1695@rogue.acs-et.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) Subject: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 13 Jul 2004 14:03:19 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi folks, I was looking at integrating ports rc.d scripts a bit better, and the following is what I came up with. I would appreciate reviews, tests, etc.. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=exp Ports related rc.d cleanups: o Separate out local (ports) scripts that use rc.d, and the old style startup/shutdown scripts and execute them separately. On startup the rc.d style scripts are executed first and then the old-style scripts. On shutdown, exactly the reverse happens. o The rc.d ports scripts should now behave more like base system scripts. Scripts ending in .sh will be sourced into the current shell, while the rest will be executed in a subshell. Previously, all ports scripts, regardless of the .sh suffix, were executed in a subshell. o The parent script, /etc/rc.d/localpkg, passes its command line arguments straight to the rc.d ports scripts. This means they should now honor faststop and faststart commands as well. Old style scripts, should not see any differences. They will still get either a start or stop command. o The initial phrase shown during shutdown has been changed to use "local packages" instead of "daemon processes" to be more inline with the phrase used during local package startup. The phrases are also used only for old-style ports script startup/shutdown, whereas previously they were being used for both rc.d and old-style scripts. This should make startup/shutdown output a bit less ugly. --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=diff Index: etc/rc.d/localpkg =================================================================== RCS file: /home/ncvs/src/etc/rc.d/localpkg,v retrieving revision 1.1 diff -u -r1.1 localpkg --- etc/rc.d/localpkg 6 Aug 2003 00:35:13 -0000 1.1 +++ etc/rc.d/localpkg 13 Jul 2004 11:30:20 -0000 @@ -11,31 +11,102 @@ . /etc/rc.subr name="localpkg" -start_cmd="pkg_start" -stop_cmd="pkg_stop" +_arg1="$1" + +# script_is_rcd script +# Checks that script is an rc.d style script. +# Returns 0 if it is, otherwise, it returns 1. +# +script_is_rcd() +{ + local _s match + _s="$1" + + [ -z "$_s" ] && return 1 + match=`grep -c -m1 '^# PROVIDE:' "$_s" 2> /dev/null` + [ "$match" = "1" ] && return 0 + return 1 +} + +# cooked_scriptlist type +# Uses values from rc.conf(5) to prepare a list of scripts to +# execute. It assumes the global variable script_name_sep and IFS are set +# properly. If type is set to the string "rcd" the list will contain only +# rc.d style scripts. If it is set to "rcOG" then it will contain +# only old style ports startup scripts. The list is echoed on stdout. +# +cooked_scriptlist() +{ + local _type slist fpattern + + slist="" + _type="$1" + case "$_type" in + rcd) + fpattern="*" + ;; + rcOG) + fpattern="*.sh" + ;; + *) + return + ;; + esac + for dir in ${local_startup}; do + if [ -d "${dir}" ]; then + for script in ${dir}/${fpattern}; do + + # Weed out scripts that don't belong in the + # category that we are preparing. + # + if [ "$_type" = "rcd" ]; then + case "$script" in + *.sample|*-dist) + continue;; + esac + script_is_rcd "$script" || continue + else + script_is_rcd "$script" && continue + fi + + slist="${slist}${script_name_sep}${script}" + done + fi + done + echo -n $slist +} pkg_start() { - # For each dir in $local_startup, search for init scripts matching *.sh - # + local slist + case ${local_startup} in [Nn][Oo] | '') ;; *) - echo -n 'Local package initialization:' slist="" if [ -z "${script_name_sep}" ]; then script_name_sep=" " fi - for dir in ${local_startup}; do - if [ -d "${dir}" ]; then - for script in ${dir}/*.sh; do - slist="${slist}${script_name_sep}${script}" - done - fi + + # Do rc.d style scripts. + # + script_save_sep="$IFS" + IFS="${script_name_sep}" + slist=`cooked_scriptlist rcd` + debug "localpkg rc.d scripts: $slist" + for script in ${slist}; do + run_rc_script "$script" "$_arg1" done + IFS="${script_save_sep}" + + # Do old-style ports startup scripts. + # + echo -n 'Local package initialization:' script_save_sep="$IFS" IFS="${script_name_sep}" + slist=`cooked_scriptlist rcOG` + debug "localpkg rcOG scripts: $slist" for script in ${slist}; do if [ -x "${script}" ]; then (set -T @@ -53,26 +124,24 @@ pkg_stop() { - echo -n 'Shutting down daemon processes:' + local slist # For each dir in $local_startup, search for init scripts matching *.sh case ${local_startup} in [Nn][Oo] | '') ;; *) - slist="" if [ -z "${script_name_sep}" ]; then script_name_sep=" " fi - for dir in ${local_startup}; do - if [ -d "${dir}" ]; then - for script in ${dir}/*.sh; do - slist="${slist}${script_name_sep}${script}" - done - fi - done + + # Do old-style scripts + # script_save_sep="$IFS" IFS="${script_name_sep}" + slist=`cooked_scriptlist rcOG` + debug "localpkg rcOG scripts: $slist" + echo -n 'Shutting down local packages:' for script in `reverse_list ${slist}`; do if [ -x "${script}" ]; then (set -T @@ -82,9 +151,35 @@ done IFS="${script_save_sep}" echo '.' + + # Do rc.d style scripts + # + script_save_sep="$IFS" + IFS="${script_name_sep}" + slist=`cooked_scriptlist rcd` + debug "localpkg rc.d scripts: $slist" + for script in `reverse_list ${slist}`; do + run_rc_script "$script" $_arg1 + done ;; esac } load_rc_config $name -run_rc_command "$1" + +# We can't use the normal rc.subr(8) start/stop plumbing +# because we call run_rc_script(), which unsets all the +# global variables that said plumbing needs. +# +case "$1" in +start|faststart) + pkg_start + ;; +stop|faststop) + pkg_stop + ;; +restart|fastrestart) + pkg_stop + pkg_start + ;; +esac --XsQoSWH+UP9D9v3l-- From owner-freebsd-rc@FreeBSD.ORG Wed Jul 14 10:37:56 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DFF516A4D5 for ; Wed, 14 Jul 2004 10:37:56 +0000 (GMT) Received: from ioskeha.hittite.isp.9tel.net (ioskeha.hittite.isp.9tel.net [62.62.156.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3EDC43D54 for ; Wed, 14 Jul 2004 10:37:55 +0000 (GMT) (envelope-from clefevre-lists@9online.fr) Received: from pc2k (unknown [80.119.154.38]) by ioskeha.hittite.isp.9tel.net (Postfix) with SMTP id 61CCE14BCB7; Wed, 14 Jul 2004 12:41:54 +0200 (CEST) Message-ID: <017401c4698e$9ea32120$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Mike Makonnen" , References: <20040713140354.GA1695@rogue.acs-et.com> Date: Wed, 14 Jul 2004 12:37:52 +0200 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: Re: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 14 Jul 2004 10:37:56 -0000 "Mike Makonnen" wrote: > > I was looking at integrating ports rc.d scripts a bit better, and the following is > what I came up with. I would appreciate reviews, tests, etc.. > Index: etc/rc.d/localpkg > =================================================================== [snip] > load_rc_config $name > -run_rc_command "$1" > + > +# We can't use the normal rc.subr(8) start/stop plumbing > +# because we call run_rc_script(), which unsets all the > +# global variables that said plumbing needs. > +# > +case "$1" in > +start|faststart) > + pkg_start > + ;; > +stop|faststop) > + pkg_stop > + ;; > +restart|fastrestart) > + pkg_stop > + pkg_start > + ;; > +esac what about other states, such as rcvar, status and poll ? what for non-standard states, such as reload, etc. Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-rc@FreeBSD.ORG Wed Jul 14 11:07:31 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 997D916A4CE; Wed, 14 Jul 2004 11:07:31 +0000 (GMT) Received: from fillmore.dyndns.org (port-212-202-50-15.dynamic.qsc.de [212.202.50.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FB7243D2D; Wed, 14 Jul 2004 11:07:31 +0000 (GMT) (envelope-from eikemeier@fillmore-labs.com) Received: from dhcp-5.local ([172.16.0.5] helo=dhcp-14.local) by fillmore.dyndns.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34 (FreeBSD)) id 1Bkhbj-00069d-7f; Wed, 14 Jul 2004 13:07:30 +0200 Date: Wed, 14 Jul 2004 13:08:13 +0200 Mime-Version: 1.0 (Apple Message framework v482) Message-Id: <19240580-D586-11D8-A6C6-00039312D914@fillmore-labs.com> In-Reply-To: <20040713140354.GA1695@rogue.acs-et.com> Content-Type: text/plain; charset=US-ASCII; format=flowed From: Oliver Eikemeier Content-Transfer-Encoding: 7bit To: Mike Makonnen User-Agent: KMail/1.5.9 cc: ports@FreeBSD.org cc: freebsd-rc@freebsd.org Subject: Re: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ports@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: Wed, 14 Jul 2004 11:07:31 -0000 Mike Makonnen wrote: > Hi folks, > > I was looking at integrating ports rc.d scripts a bit better, and the > following is > what I came up with. I would appreciate reviews, tests, etc.. [...] > Ports related rc.d cleanups: > [...] > o The rc.d ports scripts should now behave more like base system > scripts. > Scripts ending in .sh will be sourced into the current shell, while > the > rest will be executed in a subshell. Previously, all ports scripts, > regardless of the .sh suffix, were executed in a subshell. You can't do this, since it might break too many ports. See PR 56736 for an alternate approach. Follow-up to ports@, where this discussion belongs to. See for the original message. -Oliver From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 07:55:43 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D2DE16A4CE; Fri, 16 Jul 2004 07:55:43 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id D27ED43D2D; Fri, 16 Jul 2004 07:55:39 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.139] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 51756100; Fri, 16 Jul 2004 10:48:44 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6G7uAcB002057; Fri, 16 Jul 2004 10:56:17 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6FF7dBZ012628; Thu, 15 Jul 2004 18:07:39 +0300 (EAT) (envelope-from mtm) Date: Thu, 15 Jul 2004 18:07:39 +0300 From: Mike Makonnen To: Oliver Eikemeier Message-ID: <20040715150739.GA11628@rogue.acs-et.com> References: <20040713140354.GA1695@rogue.acs-et.com> <19240580-D586-11D8-A6C6-00039312D914@fillmore-labs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19240580-D586-11D8-A6C6-00039312D914@fillmore-labs.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) cc: ports@FreeBSD.Org cc: freebsd-rc@FreeBSD.Org Subject: Re: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 16 Jul 2004 07:55:43 -0000 On Wed, Jul 14, 2004 at 01:08:13PM +0200, Oliver Eikemeier wrote: > Mike Makonnen wrote: > > >Hi folks, > > > >I was looking at integrating ports rc.d scripts a bit better, and the > >following is > >what I came up with. I would appreciate reviews, tests, etc.. > [...] > >Ports related rc.d cleanups: > >[...] > >o The rc.d ports scripts should now behave more like base system > >scripts. > > Scripts ending in .sh will be sourced into the current shell, while > >the > > rest will be executed in a subshell. Previously, all ports scripts, > > regardless of the .sh suffix, were executed in a subshell. > > You can't do this, since it might break too many ports. See PR 56736 for > an alternate approach. Yes, I noticed that this broke cups.sh on my system. I had intended to mention that this would, at a minimum, require a HEADS UP to ports@ before committing, but clicked "Send" to quickly... To address some of your concerns: 1. Ports startup scripts breaking: Part of this was my fault. When I committed rc.d/localpkg I should have anticipated that ports scripts would start using rc.d style scripts, and should have essentially committed this patch then. But I didn't. That may have been short-sightedness on my part, but it would have been nice if ports@ could have coordinated with rc@ (or at the time freebsd-rc@yahoogroups.com) before starting to use rc.d style scripts. As I see it now, ports scripts *are* broken because, among other things, they expect .sh scripts to be sourced in a sub-shell. The only problem I see with this is that some of the scripts call exit, which would essentially also exit the localpkg script before it had a chance to run the rest of the ports scripts. As far as I am concerned rc.d behaviour is that .sh scripts are sourced in the current shell, and others in a subshell. All scripts, be they base or ports should follow this behaviour. To have inconsistent behaviour between base and ports scripts is a bug IMO. The PR you cited mentioned something about changing the suffixes, but I think that would be a gratuitous digression from behaviour in NetBSD. In short: current ports scripts behaviour is broken and should be changed as soon as possible instead of trying to patch rc.d/localpkg to accept and propagate their brokeness through 5-STABLE. 2. Starting base rc.d and ports rc.d scripts together from /etc/rc: The last patch in the PR seems to be a fairly practical way of doing this, but would require some broader discussion. I'm also a little uncomfortable about it because mixing in ports daemons with base system daemons in a way that is not deterministic at startup may have security implications. It's fairly easy for an administrator to audit the base system startup order, but when you start introducing ports (third party applications of varying quality) into the mix it becomes a lot harder to know if you are introducing a source of insecurity. This may or may not be a valid concern, but this close to 5-STABLE I think we should hold off on it. In anycase I think this is a separate issue and should be dealt with separately. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 08:23:47 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BD1D16A4CE; Fri, 16 Jul 2004 08:23:47 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7AEC43D53; Fri, 16 Jul 2004 08:23:43 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.139] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 51760019; Fri, 16 Jul 2004 11:17:03 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6G8NkMQ008504; Fri, 16 Jul 2004 11:23:57 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6G8NZaI008503; Fri, 16 Jul 2004 11:23:35 +0300 (EAT) (envelope-from mtm) Date: Fri, 16 Jul 2004 11:23:29 +0300 From: Mike Makonnen To: Oliver Eikemeier Message-ID: <20040716082329.GA8472@rogue.acs-et.com> References: <20040713140354.GA1695@rogue.acs-et.com> <19240580-D586-11D8-A6C6-00039312D914@fillmore-labs.com> <20040715150739.GA11628@rogue.acs-et.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <20040715150739.GA11628@rogue.acs-et.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) cc: ports@freebsd.org cc: freebsd-rc@freebsd.org Subject: Re: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 16 Jul 2004 08:23:47 -0000 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I forgot to add an updated patch. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=diff Index: etc/rc.d/localpkg =================================================================== RCS file: /home/ncvs/src/etc/rc.d/localpkg,v retrieving revision 1.1 diff -u -r1.1 localpkg --- etc/rc.d/localpkg 6 Aug 2003 00:35:13 -0000 1.1 +++ etc/rc.d/localpkg 15 Jul 2004 07:38:51 -0000 @@ -11,31 +11,120 @@ . /etc/rc.subr name="localpkg" -start_cmd="pkg_start" -stop_cmd="pkg_stop" +_arg1="$1" -pkg_start() +# script_is_rcd script +# Checks that script is an rc.d style script. +# Returns 0 if it is, otherwise, it returns 1. +# +script_is_rcd() { - # For each dir in $local_startup, search for init scripts matching *.sh + local _s match + _s="$1" + + [ -z "$_s" ] && return 1 + match=`grep -c -m1 '^# PROVIDE:' "$_s" 2> /dev/null` + [ "$match" = "1" ] && return 0 + return 1 +} + +# cooked_scriptlist type +# Uses values from rc.conf(5) to prepare a list of scripts to +# execute. It assumes the global variable script_name_sep and IFS are set +# properly. If type is set to the string "rcd" the list will contain only +# rc.d style scripts and they will be ordered according to thier +# dependencies. If it is set to "rcOG" then it will contain +# only old style ports startup scripts. The list is echoed on stdout. +# +cooked_scriptlist() +{ + local _type slist fpattern skip + + slist="" + _type="$1" + case "$_type" in + rcd) + fpattern="*" + ;; + rcOG) + fpattern="*.sh" + ;; + *) + return + ;; + esac + for dir in ${local_startup}; do + if [ -d "${dir}" ]; then + for script in ${dir}/${fpattern}; do + + # Weed out scripts that don't belong in the + # category that we are preparing. + # + if [ "$_type" = "rcd" ]; then + case "$script" in + *.sample|*-dist) + continue;; + esac + script_is_rcd "$script" || continue + else + script_is_rcd "$script" && continue + fi + + slist="${slist}${script_name_sep}${script}" + done + fi + done + + # If this is an rc.d list put the scripts in the right order. # + if [ "$_type" = "rcd" ]; then + skip="-s nostart" + [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && \ + skip="$skip -s nojail" + + # Some scripts do not define a FreeBSD keyword, so we can't + # specify it in a keep list. + slist=`/sbin/rcorder ${skip} ${slist} 2>/dev/null` + + # Substitute the newlines used by rcorder(8) with the + # script separator. + slist=`echo $slist | /usr/bin/tr "\n" "$script_name_sep"` + fi + + echo -n $slist +} + +pkg_start() +{ + local slist + case ${local_startup} in [Nn][Oo] | '') ;; *) - echo -n 'Local package initialization:' slist="" if [ -z "${script_name_sep}" ]; then script_name_sep=" " fi - for dir in ${local_startup}; do - if [ -d "${dir}" ]; then - for script in ${dir}/*.sh; do - slist="${slist}${script_name_sep}${script}" - done - fi + + # Do rc.d style scripts. + # + script_save_sep="$IFS" + IFS="${script_name_sep}" + slist=`cooked_scriptlist rcd` + debug "localpkg rc.d scripts: $slist" + for script in ${slist}; do + run_rc_script "$script" "$_arg1" done + IFS="${script_save_sep}" + + # Do old-style ports startup scripts. + # + echo -n 'Local package initialization:' script_save_sep="$IFS" IFS="${script_name_sep}" + slist=`cooked_scriptlist rcOG` + debug "localpkg rcOG scripts: $slist" for script in ${slist}; do if [ -x "${script}" ]; then (set -T @@ -53,26 +142,24 @@ pkg_stop() { - echo -n 'Shutting down daemon processes:' + local slist # For each dir in $local_startup, search for init scripts matching *.sh case ${local_startup} in [Nn][Oo] | '') ;; *) - slist="" if [ -z "${script_name_sep}" ]; then script_name_sep=" " fi - for dir in ${local_startup}; do - if [ -d "${dir}" ]; then - for script in ${dir}/*.sh; do - slist="${slist}${script_name_sep}${script}" - done - fi - done + + # Do old-style scripts + # script_save_sep="$IFS" IFS="${script_name_sep}" + slist=`cooked_scriptlist rcOG` + debug "localpkg rcOG scripts: $slist" + echo -n 'Shutting down local packages:' for script in `reverse_list ${slist}`; do if [ -x "${script}" ]; then (set -T @@ -82,9 +169,35 @@ done IFS="${script_save_sep}" echo '.' + + # Do rc.d style scripts + # + script_save_sep="$IFS" + IFS="${script_name_sep}" + slist=`cooked_scriptlist rcd` + debug "localpkg rc.d scripts: $slist" + for script in `reverse_list ${slist}`; do + run_rc_script "$script" $_arg1 + done ;; esac } load_rc_config $name -run_rc_command "$1" + +# We can't use the normal rc.subr(8) start/stop plumbing +# because we call run_rc_script(), which unsets all the +# global variables that said plumbing needs. +# +case "$1" in +start|faststart) + pkg_start + ;; +stop|faststop) + pkg_stop + ;; +restart|fastrestart) + pkg_stop + pkg_start + ;; +esac --6TrnltStXW4iwmi0-- From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 14:40:22 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7876C16A4CE; Fri, 16 Jul 2004 14:40:22 +0000 (GMT) Received: from telecom.net.et (ns2.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1A5843D1D; Fri, 16 Jul 2004 14:40:18 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.139] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 51796396; Fri, 16 Jul 2004 17:33:40 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6GEfGBh016501; Fri, 16 Jul 2004 17:41:17 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6GEfEZ4016500; Fri, 16 Jul 2004 17:41:14 +0300 (EAT) (envelope-from mtm) Date: Fri, 16 Jul 2004 17:41:12 +0300 From: Mike Makonnen To: Oliver Eikemeier Message-ID: <20040716144112.GA10133@rogue.acs-et.com> References: <20040715150739.GA11628@rogue.acs-et.com> <7B900F95-D70F-11D8-8DBE-00039312D914@fillmore-labs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7B900F95-D70F-11D8-8DBE-00039312D914@fillmore-labs.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) cc: ports@freebsd.org cc: freebsd-rc@freebsd.org Subject: Re: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 16 Jul 2004 14:40:22 -0000 On Fri, Jul 16, 2004 at 12:04:10PM +0200, Oliver Eikemeier wrote: > Mike Makonnen wrote: > > >1. Ports startup scripts breaking: > > [...] > > As I see it now, ports scripts *are* broken because, among other > > things, they expect .sh scripts to be sourced in a sub-shell. [...] > > As far as I am concerned rc.d behaviour is that .sh scripts are > > sourced in the current shell, and others in a subshell. All scripts, > > be they base or ports should follow this behaviour. To have > > inconsistent behaviour between base and ports scripts is a > > bug IMO. The PR you cited mentioned something about changing the > > suffixes, but I think that would be a gratuitous digression from > > behaviour in NetBSD. > > > > In short: current ports scripts behaviour is broken and should be > > changed as soon as possible instead of trying to patch rc.d/localpkg > > to accept and propagate their brokeness through 5-STABLE. > > AFAICS fews scripts in /etc/rc.d use the sourcing mechanism. Your > definition of brokeness seems very NetBSD centric too me, how about > using a different extension on FreeBSD (.src for sourced rc :) ) and > adding a `case' depending on OS to the mechanism? NetBSD could even > merge this, when they want to. I can assure you that you open a major > can of worms when you try to `fix' all FreeBSD ports, including > introducing an incompatibility with 4.x. > The rc.d style ports scripts' behaviour diverge from that of base system rc.d scripts. The main culprit is not enough communication among rc.d developers and ports developers. That does not mean that we should change the relatively stable/expected behaviour of rc.d to accomodate ports rc.d behaviour which is still in a relative state of flux. I'll bring this up with re, and portmgr, and see what they have to say. > I think we should introduce this before 5-STABLE, especially since the > current estimated time frame gives us enough room for testing. If you > want to follow the NetBSD way, you have to add racoon, ports ppp daemons > and other port startup scripts to /etc/rc.d, which IMHO makes no sense > of FreeBSD. This is something that enables to use port features from the > base system, replace base system functionality by ports or even move > parts of the base to ports without any negative impacts. Besides, we > finally have a way to get a proper startup order for ports scripts > without using `000.'. It should be easily possible to either require a > special keyword for ports scripts to get sorted before a certain point, > or assure that most scripts are started after most of the base is up. It's not as simple as that. Besides the security implications there are also many possible corner cases. To name just a couple: diskless, / (root partition), /usr/local, /usr/X11R6 on different partitions or even mounted remotely, etc... How is rc(8) going to handle all these possible scenarios. It's possible, but it's not trivial. And this close to 5-STABLE is not the time to start experimenting with it. If you feel otherwise, then separate this particular issue out from your patch and post to -arch. P.S. - STOP TRIMMING FREEBSD-RC OUT OF THE CC LIST! Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 14:51:25 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E9F716A4CE; Fri, 16 Jul 2004 14:51:25 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9FBB43D46; Fri, 16 Jul 2004 14:51:22 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.139] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 51797102; Fri, 16 Jul 2004 17:44:41 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6GEqIA8016533; Fri, 16 Jul 2004 17:52:20 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6GEqHKp016532; Fri, 16 Jul 2004 17:52:17 +0300 (EAT) (envelope-from mtm) Date: Fri, 16 Jul 2004 17:52:16 +0300 From: Mike Makonnen To: "Simon L. Nielsen" Message-ID: <20040716145216.GB10133@rogue.acs-et.com> References: <20040711115238.GB753@zaphod.nitro.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20040711115238.GB753@zaphod.nitro.dk> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) cc: freebsd-rc@FreeBSD.org Subject: Re: Enhancement to gbde rc.d script (try 2) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 16 Jul 2004 14:51:25 -0000 I think you should directly ask someone who is familiar with gbde and knows how it's supposed to work. It doesn't really belong on -rc@. Cheers. --=20 Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4= 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 14:56:06 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4FEA16A4CE for ; Fri, 16 Jul 2004 14:56:06 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id B27D943D45 for ; Fri, 16 Jul 2004 14:56:04 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.139] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 51797557; Fri, 16 Jul 2004 17:49:27 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6GEuW1X039260; Fri, 16 Jul 2004 17:56:40 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6GEuPwE039259; Fri, 16 Jul 2004 17:56:25 +0300 (EAT) (envelope-from mtm) Date: Fri, 16 Jul 2004 17:56:23 +0300 From: Mike Makonnen To: Cyrille Lefevre Message-ID: <20040716145622.GC10133@rogue.acs-et.com> References: <20040713140354.GA1695@rogue.acs-et.com> <017401c4698e$9ea32120$7890a8c0@dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <017401c4698e$9ea32120$7890a8c0@dyndns.org> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) cc: freebsd-rc@FreeBSD.org Subject: Re: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 16 Jul 2004 14:56:06 -0000 On Wed, Jul 14, 2004 at 12:37:52PM +0200, Cyrille Lefevre wrote: > "Mike Makonnen" wrote: > > > > I was looking at integrating ports rc.d scripts a bit better, and the > following is > > what I came up with. I would appreciate reviews, tests, etc.. > > > > Index: etc/rc.d/localpkg > > =================================================================== > [snip] > > load_rc_config $name > > -run_rc_command "$1" > > + > > +# We can't use the normal rc.subr(8) start/stop plumbing > > +# because we call run_rc_script(), which unsets all the > > +# global variables that said plumbing needs. > > +# > > +case "$1" in > > +start|faststart) > > + pkg_start > > + ;; > > +stop|faststop) > > + pkg_stop > > + ;; > > +restart|fastrestart) > > + pkg_stop > > + pkg_start > > + ;; > > +esac > > what about other states, such as rcvar, status and poll ? > what for non-standard states, such as reload, etc. This script is intended more for startup/shutdown use. Anything more would be overkill. If I want to find out the status of a I should use the rc.d script belonging to the program. Although status might be convenient to have... Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 15:08:10 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0F5716A4CE for ; Fri, 16 Jul 2004 15:08:10 +0000 (GMT) Received: from mail-white.research.att.com (mail-red.research.att.com [192.20.225.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id A16EF43D3F for ; Fri, 16 Jul 2004 15:08:10 +0000 (GMT) (envelope-from fenner@research.att.com) Received: from mail-green.research.att.com (mail-green.research.att.com [135.207.30.103]) by mail-white.research.att.com (Postfix) with ESMTP id 12DFE664062 for ; Fri, 16 Jul 2004 11:08:09 -0400 (EDT) Received: from windsor.research.att.com (windsor.research.att.com [135.207.26.46]) by mail-green.research.att.com (Postfix) with ESMTP id 4FFB0A7B86 for ; Fri, 16 Jul 2004 11:08:09 -0400 (EDT) Received: (from fenner@localhost) by windsor.research.att.com (8.11.6+Sun/8.8.5) id i6GF88u10421; Fri, 16 Jul 2004 08:08:08 -0700 (PDT) Message-Id: <200407161508.i6GF88u10421@windsor.research.att.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: freebsd-rc@freebsd.org Date: Fri, 16 Jul 2004 08:08:07 -0700 From: Bill Fenner Versions: dmail (solaris) 2.6d/makemail 2.10 Subject: rc.d cleanups X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 16 Jul 2004 15:08:11 -0000 Folks, A couple of years ago, I did some rc.d cleanups. A summary is at the top of http://people.freebsd.org/~fenner/rc.d.diff . Unfortunately, I did all the work right around the time of 5.1-RELEASE, so didn't want to commit during the freeze, and never came back to it afterwards. I'd like to come back to it now; the exact rc.d.diff doesn't apply but there are still lots of scripts that don't use the rc.subr infrastructure properly (new ones, too). Before I do a bunch of work and let it fall by the wayside again, I'd like to get comments on the various components of the changes, and whether people think it makes sense to do this kind of cleanup (in particular, making sure that scripts don't do anything that's not mediated by run_rc_command). Thanks, Bill From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 15:16:29 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9D8416A4CE; Fri, 16 Jul 2004 15:16:29 +0000 (GMT) Received: from fillmore.dyndns.org (port-212-202-50-15.dynamic.qsc.de [212.202.50.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 643B043D49; Fri, 16 Jul 2004 15:16:29 +0000 (GMT) (envelope-from eikemeier@fillmore-labs.com) Received: from dhcp-14.local ([172.16.0.14] helo=dhcp-5.local) by fillmore.dyndns.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.40 (FreeBSD)) id 1BlURl-000D9u-S0; Fri, 16 Jul 2004 17:16:28 +0200 Date: Fri, 16 Jul 2004 17:17:14 +0200 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v482) To: Mike Makonnen From: Oliver Eikemeier In-Reply-To: <20040716144112.GA10133@rogue.acs-et.com> Message-Id: <38080924-D73B-11D8-8DBE-00039312D914@fillmore-labs.com> Content-Transfer-Encoding: 7bit User-Agent: KMail/1.5.9 cc: ports@FreeBSD.org cc: freebsd-rc@freebsd.org Subject: Re: localpkg script changes X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 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, 16 Jul 2004 15:16:29 -0000 Mike Makonnen wrote: > The rc.d style ports scripts' behaviour diverge from that of base system > rc.d scripts. The main culprit is not enough communication among rc.d > developers and ports developers. Now, here we go... > That does not mean that we should change > the relatively stable/expected behaviour of rc.d to accomodate ports > rc.d > behaviour which is still in a relative state of flux. What do you mean with `in a relative state of flux'? Could you please elaborate what you would expect before you would describe rc.d for ports as stable? > I'll bring this up with re, and portmgr, and see what they have to say. My 2 eurocents: Add at least ports-developers to the discussion. The discussion could only benefit from the input of some experienced porters. >> I think we should introduce this before 5-STABLE, especially since the >> current estimated time frame gives us enough room for testing. [...] > > It's not as simple as that. Besides the security implications there are > also > many possible corner cases. To name just a couple: diskless, / (root > partition), > /usr/local, /usr/X11R6 on different partitions or even mounted > remotely, etc... I can't see any security implications here, and when you manage to get things working diskless, I can't see any problems when /usr/local and /usr/X11R6 are on different partitions... Could you just name some *real* problems instead of just stating that it is `difficult', so that we can start to work on them? > How is rc(8) going to handle all these possible scenarios. It's > possible, > but it's not trivial. And this close to 5-STABLE is not the time to > start > experimenting with it. If you feel otherwise, then separate this > particular > issue out from your patch and post to -arch. I feel otherwise, see my last post. Also, since ports are concerned, I believe ports@ is the right list for this. I think not many porters read arch@, and nobody reads rc@. > P.S. - STOP TRIMMING FREEBSD-RC OUT OF THE CC LIST! Your wish is my command. Anyway, changes on localpkg mostly affect ports, not the rc.subr system. I don't like cross-posting, but since the noise level on rc@ is nearly zero I guess nobody there will mind. -Oliver