Date: Wed, 15 Jun 2005 10:30:21 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: "J.R. Oldroyd" <fbsd@opal.com> Cc: Doug Barton <dougb@FreeBSD.org>, freebsd-rc@FreeBSD.org Subject: Re: Use of rcorder for local rc.d/*.sh scripts Message-ID: <20050615173021.GB15807@odin.ac.hmc.edu> In-Reply-To: <20050615162948.GG16676@linwhf.opal.com> References: <20050609201017.GA10248@odin.ac.hmc.edu> <42A8A91B.8000402@FreeBSD.org> <20050609210223.GB16168@odin.ac.hmc.edu> <20050612121504.K844@ync.qbhto.arg> <20050613005533.GA28966@odin.ac.hmc.edu> <42AD19C9.2040403@FreeBSD.org> <20050613155211.GB19722@odin.ac.hmc.edu> <20050614134732.GB16676@linwhf.opal.com> <20050614172740.GC20371@odin.ac.hmc.edu> <20050615162948.GG16676@linwhf.opal.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 15, 2005 at 12:29:48PM -0400, J.R. Oldroyd wrote: > On Jun 14, 10:27, Brooks Davis wrote: > > On Tue, Jun 14, 2005 at 09:47:32AM -0400, J.R. Oldroyd wrote: > >=20 > > > A. NOW: > > > /etc/rc.d rcordered with "foo" run in subshell and > > > "foo.sh" sourced > > > local dirs "foo.sh" run in subshell from localpkg > > > in alphabetical order > > >=20 > > > B. SOON: > > > /etc/rc.d rcordered with "foo" run in subshell and > > > "foo.sh" sourced > > > local dirs "[0-9]foo.sh" scripts are run in a subshell > > > first, then "[^0-9]foo.sh" and executable > > > "[^0-9]foo" scripts run rcordered and run in > > > subshells; "foo.xyz" (e.g., ".sample") ignored? > > > ACTION required of port maintainers: NONE > >=20 > > One concern I have here is what does first mean? It seems like we may > > need to run as early as immediatly after mountcritremote which does > > change the order a bit and would require a new rc script, something like > > localpkg-early. > >=20 > I meant first in localpkg. Or in a localpkg-early script, but I don't > see the need for an extra script. The reason I think we may need an early script is that we're going to be moving some scripts well before localpkg. > > I'm not quite sure about the exclusions for rcorder. The *.* exclusion > > seems like an easy way to avoid *.sh, *.sample, *.orig, *.bak, etc. I'm > > not sure what the point of the [^0-9] is though, it would seem that the > > logical migration path would be for users to add appropriate dependency > > tags to their scripts and set a ports Makefile variable to cause the .sh > > to be stripped when installing on appropriate versions of FreeBSD. > > Removing the ### bits could be done after the flagday. > >=20 > We need to pin this down. The goal is to exclude junk files. > If "*.*" is the simplest pattern that does this, great; if not, we > need a more explicit list such as "*.bak *.orig *.sample" etc. I think *.* is fine. I'd prefer to complain about them from the beginning so we catch any exceptions (possibly suppressing warnings for obvious examples like *.bak, *.orig, *.sample). > I would prefer to see (in the final "C." version) that the ONLY > things allowed in the local rc.d dirs are "foo.sh" files which are > sourced and "foo" files which are run in a subshell, so as to be > consistent with /etc/rc.d. I.e., in the intermediate "B." version, > anything that is identifiably not this needs to generate a warning. I agree. > Are we in agreement that the intermediate "B." versions should not > break anything and should not require any changes by port maintainers? I think this is a good idea and maximizes our changes of successful integration. > > I'd be strongly tempted to require the documented rcorder pattern be > > matched by the script in addition to the other exclustions. We should > > have egrep at this point so that should be easy. > >=20 > Working, still, on the basis of the intermediate version not requiring > any changes from port maintainers in order to preserve existing > functionality, but accepting that we do want to allow maintainers > to access the new functionality if they indicate it, here's what > I'm now thinking: we only want to require the use of keywords > or tag checking if a port maintainer wants to have a "foo.sh" file > sourced. >=20 > If we're not changing /etc/rc and adding the transition functionality > in localpkg, the transition localpkg will have to: >=20 > process local scripts [0-9]*.sh (in order to preserve > current behavior) >=20 > - warn and don't run non-executable files >=20 > - warn and don't run files named "*.sample", > "*.bak", "*.orig" etc >=20 > - warn (suggesting name change) but do run (in > subshell), files named "[0-9]*.sh" >=20 > rcorder and process all the remianing local scripts > (rcorder will include non-tagged files at the > end of its sorted list, so these are included here > too): >=20 > - warn and don't run non-executable files >=20 > - warn and don't run files named "*.sample", > "*.bak", "*.orig" etc >=20 > - warn (suggesting name change) but do run (in > subshell) files named "[^0-9]*.sh" without > new RC_SUBR keyword >=20 > - quietly run (as sourced file) files named > "[^0-9]*.sh" which have new RC_SUBR keyword > (but note that we're in localpkg here, not > /etc/rc so sourcing not quite the same, unless > we do move this functionality into /etc/rc now) I'd rather not support sourcing at all until full transition. I'd rather force porters to install files in /etc/rc.d for now if they want sourcing. > - quietly run (in subshell) all other files with > rcorder tags >=20 > - warn and don't run any remaining files >=20 > I don't think we need to require checking for a keyword in files > named "foo". If we've identified a proper exclusion list and checked > for rcorder tags on "foo" files, we're not going to be running any > "foo" files which are junk. I dislike the idea of obliging port > maintainers to add temporary keywords which have to be removed > later; the above only requires this for functionality not currently > available. I'm not suggesting keywords, I'm suggesting checking for: ^# (REQUIRE|PROVIDE|BEFORE|KEYWORD): This seems like a reasonable thing to do because none of these scripts will run now. > On the flag day, the final version would be to remove the localpkg > script and go to the modified /etc/rc which I posted last week. > Since by then, there should no longer be any junk files, and > foo/foo.sh semantics will be the same as /etc/rc.d, so that version > of /etc/rc should work as proposed. Ah, I see why the disconnect on localpkg-early above. I was thinking we'd do the rcordering in /etc/rc in B which would change things a bit, but could still be basically compatible. Just doing it in localpkg seems like it may not offer the benefits people want. > > I'd like to whine about any files that aren't run, probalby in localpkg. > > It's fairly easy to do and would provide a push to get rid of the > > various .sample bits. > >=20 > Agreed - see above. >=20 >=20 > > > C. AT FUTURE FLAGDAY: > > > /etc/rc.d+local rcordered with "foo" run in subshell and > > > "foo.sh" sourced; "foo.xyz" files now treated > > > as "foo" > > > ACTION required of port maintainers: > > > - add rcorder tags to all scripts > > > - rename "foo.sh" to "foo" unless sourced > > > behavior is desired > >=20 > > I think we should be able to automate this via USE_RC_SUBR and/or > > RC_ORDER. > >=20 >=20 > I'm worried that using these keywords as the control to install > files/foo.sh.in as rc.d/foo makes it hard to distunguish between > ports which want to install both foo.sh and foo startup scripts > (the former to be sourced, the latter to be run in a subshell)? It > may be easier just to require port maintainers to rename files/foo.sh.in > to files/foo.in which they can do at any point the transition period. I'm more concerned about supporting installing .sh scripts on 5.x for the next two years than I am about supporting the installation of .sh scripts to be sourced two years now. > > > My thought is that to oblige port maintainers to make changes in > > > the short term will be hard. Give them some time (between points > > > B. and C. and acceptance of the change will be a lot easier). > > >=20 > > > So let's provide intermediate rc, rc.subr and localpkg scripts that > > > may be larger and more complex, but which don't place an immediate > > > burden on 13,000 port maintainers. Then provide a final set of > > > scripts which do. The intermediate scripts can provide warning > > > messages that alert that a change may be needed. > >=20 > > I agree. I'd like to do the spadework to make the major benefits > > available for 6.0 and then take the time between 6.0 and 7.0 to work > > towards the flag day. There's no reason not to make the full transition > > in ports before 7.0 so all the flagday does is make old junk stop > > working, as long as we do the work to warn about old style bits from > > the beginning. > >=20 > I'm surprised you're saying we need to wait as long as 7.0 for the > flag day. Isn't that over 18 months away? Wouldn't something like > a three or six month transition period be enough? After a HEADSUP and > warnings, I'd imagine that would be long enough for port maintainers > to make the needed changes. If we can't make major changes to the startup script processing in the 6.x line once 6.0-RELEASE happens. Anything that would break user scripts would be specifically disallowed. The rule of the project is that we generally have to deprecate a major interface for one release branch before we can break it. The rules for determining which scripts are run definitely falls into this category. Remember, we're not just dealing with ports, we're also dealing with weird user scripts so we need to give them plenty of warning. If we weren't so close to 6.0 release, we might be able to get away with warnings in 5.x and full deprecation in 6.0, but I think we're too late for that. This is why I'd like to see some modifications to /etc/rc in addition to localpkg. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --NDin8bjvE/0mNLFQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCsGWrXY6L6fI4GtQRAr2UAKCm7qCBJRT18cL/IYtazOdk/iRWEACgxuz2 x6U5P9l24tAq0RZ9RwnPNtc= =vsY3 -----END PGP SIGNATURE----- --NDin8bjvE/0mNLFQ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050615173021.GB15807>