From owner-freebsd-arch@FreeBSD.ORG Mon Feb 23 02:46:27 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 153DC16A4CE for ; Mon, 23 Feb 2004 02:46:27 -0800 (PST) Received: from postman.arcor.de (postman4.arcor-online.net [151.189.0.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A09A43D2D for ; Mon, 23 Feb 2004 02:46:26 -0800 (PST) (envelope-from eikemeier@fillmore-labs.com) Received: from fillmore.dyndns.org (port-212-202-51-138.reverse.qsc.de [212.202.51.138]) (authenticated bits=0)i1NAkNUa002140 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 23 Feb 2004 11:46:24 +0100 (MET) Received: from [172.16.0.2] (helo=fillmore-labs.com) by fillmore.dyndns.org with esmtp (Exim 4.30; FreeBSD) id 1AvDbR-000EU5-Q7; Mon, 23 Feb 2004 11:46:21 +0100 Message-ID: <4039D9FF.40208@fillmore-labs.com> Date: Mon, 23 Feb 2004 11:46:23 +0100 From: Oliver Eikemeier Organization: Fillmore Labs GmbH - http://www.fillmore-labs.com/ MIME-Version: 1.0 To: Mike Makonnen References: <20040223084146.GA4202@mobile.acs-et.com> In-Reply-To: <20040223084146.GA4202@mobile.acs-et.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: KMail/1.5.9 cc: freebsd-arch@freebsd.org Subject: Re: rc.d and ports X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2004 10:46:27 -0000 Mike Makonnen wrote: > Hi, > > A lot of people have been calling to have ports startup scripts > integrated into rc.d. I have finally gotten arround to doing it. > Attached are the rc.d patches to make it work, but > I will need some cooperation from the ports folks. See PR 56736, there since Sep 2003: If you don't like it, please provide feedback what you think can be improved. > Essentialy the rc.d patches will recognize a ports script and source > the appropriate configuration files. From the user's point of view > there will be two major differences: > 1. No more fooport.sh-sample files that must be renamed to enable the port > 2. Ports can be configured from /etc/rc.conf (or /usr/local/etc/rc.conf). Except the /usr/local/etc/rc.conf this is what a lot of ports already do. > To make this work here's what's needed from the ports makefiles. > This is just a general sketch of what needs to be done. The > ports folks can do this however they deem appropriate. > > The makefile for the port should define a variable: > > RCVAR_NAME="fooport_enable" > > Then, logic similar to this should be inserted in the appropriate > bsd.port* makefile: > > if ! grep 1>/dev/null "\$${RCVAR_NAME}=" ${PREFIX}/etc/defaults/rc.conf ; then > echo "${RCVAR_NAME}=NO" >> ${PREFIX}/etc/defaults/rc.conf > fi I guess we don't need this (and shouldn't do it, since ${PREFIX}/etc/defaults/rc.conf might be read-only). Defaulting xxx_enable to "NO" seems to be sufficient, with [ -z "$xxx_enable" ] && xxx_enable="NO" or xxx_enable=${xxx_enable:-"NO"} before calling load_rc_config $name > [...] > > I know from cursory glances at -current mail that people are divided > on whether to have /usr/local/etc/{rc.conf,rc.conf.d} or to support > only /etc/rc.conf. Both will be supported. It's the user's choice > whether he wants every thing in /etc/rc.conf or /usr/local/etc/rc.conf. > However, a /usr/local/etc/defaults/rc.conf is needed because that is where > the default values for ports config knobs will be kept and because they > should be kept separately from base system knobs. Adding /usr/local/etc/rc.conf maybe a good idea, but I don't see the need for a /usr/local/etc/defaults/rc.conf. > Comments/Corrections solicited. See above. If I get feedback I well incorporate /usr/local/etc/defaults/rc.conf support in PR 56736. Regards Oliver