From owner-freebsd-rc@FreeBSD.ORG Mon Aug 16 16:50:45 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 D61F716A4F1; Mon, 16 Aug 2004 16:50:44 +0000 (GMT) Received: from postal3.es.net (postal3.es.net [198.128.3.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C55D43D55; Mon, 16 Aug 2004 16:50:37 +0000 (GMT) (envelope-from oberman@es.net) Received: from ptavv.es.net ([198.128.4.29]) by postal3.es.net (Postal Node 3) with ESMTP (SSL) id IBA74465; Mon, 16 Aug 2004 09:50:36 -0700 Received: from ptavv (localhost [127.0.0.1]) by ptavv.es.net (Tachyon Server) with ESMTP id C9B525D0A; Mon, 16 Aug 2004 09:50:35 -0700 (PDT) To: Mike Makonnen In-reply-to: Your message of "Mon, 16 Aug 2004 18:56:53 +0300." <20040816155653.GA2405@rogue.acs-et.com> Date: Mon, 16 Aug 2004 09:50:35 -0700 From: "Kevin Oberman" Message-Id: <20040816165035.C9B525D0A@ptavv.es.net> cc: freebsd-rc@freebsd.org cc: current@freebsd.org Subject: Re: RFC: Alternate patch to have true new-style rc.d scripts in ports (without touching localpkg) 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: Mon, 16 Aug 2004 16:50:46 -0000 > Date: Mon, 16 Aug 2004 18:56:53 +0300 > From: Mike Makonnen > Sender: owner-freebsd-current@freebsd.org > > I have thought about this considerably, and I think the best solution > is to have ports rc.d scripts installed to /etc/rc.d. One of the problems > with having them in a separate directory is that we don't know when > that directory will be available, so we have to order the scripts > in two phases: first /etc/rc.d and then the ports rc.d directory when > it is ready. If we do this then there is the REAL possiblity that > something may not get run the second time around. For example, let's > say that /etc/rc re-orders all the scripts (base and local) when it > hits the dummy script PORTS. Furthermore, after they are reordered we > skip the scripts that come before PORTS. The problem is that When the scripts > are reordered if a particular script does not have a dependency on PORTS (or > another script that requires PORTS) you are not guaranteed that if it came > after PORTS the first time it will still be after ports after the second > reordering. > > While you can have workarounds and introduce hacks around this problem, I > think the general messiness and potential problems of ordering scripts > more than once makes it a bad solution. > > Secondly, there is really no compelling reason that all ports be > ordered with the base scripts. If a port is of such a nature that it > needs to be started much earlier than it currently is, either the ports > should install the script automatically to /etc/rc.d or it should give > the user the option of choosing. > > So, I think the best course of action is to convert all ports startup > scripts to rc.d format and either > a) install them all automatically to /etc/rc.d > b) leave it to the port maintainer to choose > c) leave it to the user to choose. > > If we go with b or c, then /etc/rc.d/localpkg will need to learn to order > rc.d scripts. I have a patch for that which is similar to the one I committed > except that it has a list of the broken scripts which end in .sh that it > treats like old style scripts (this should preserve compatibility with those > upgrading from an older release): > http://people.freebsd.org/~mtm/patches/localpkg.diff I'm all for putting all rc.d scripts in a subdirectory of /etc. As you point out, some things need to run early in the boot operation. I have one tool in mind, Tobias Roth's profile. But it absolutely MUST run long before /usr/local is available. On the other hand, I don't like putting them into /etc/rc.d. This makes the mergemaster check for orphaned startup scripts fail and can be confusing. I would suggest that the right answer is a new directory. I'm not sure whether /etc/rc.d.local or /etc/rc.d/local or /etc/local/rc.d would be the best choice. I tend to favor the latter, but I can see some objections about such a modification to hier(7). Any of these would make me happier than the previous proposals. I really dislike the hacks required to make /usr/local/etc work correctly and not just in regard to rcng. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634