From owner-freebsd-ports Thu Mar 13 12:15:47 2003 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C459937B401 for ; Thu, 13 Mar 2003 12:15:45 -0800 (PST) Received: from mail.westbend.net (ns1.westbend.net [216.47.253.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9A6343FA3 for ; Thu, 13 Mar 2003 12:15:44 -0800 (PST) (envelope-from hetzels@westbend.net) Received: from ADMIN00 (WBIw005.westbend.net [216.47.253.25]) by mail.westbend.net (8.12.8/8.12.8) with SMTP id h2DKFeZZ037389; Thu, 13 Mar 2003 14:15:40 -0600 (CST) (envelope-from hetzels@westbend.net) Message-ID: <016b01c2e99d$51c24a60$19fd2fd8@westbend.net> From: "Scot Hetzel" To: "Richard Nyberg" , References: <20030313100830.GA30175@murmeldjur.it.su.se> Subject: Re: port rc.d files Date: Thu, 13 Mar 2003 14:15:40 -0600 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.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Spam-Status: No, hits=-0.3 required=8.0 tests=QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01, USER_AGENT_OE version=2.43 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org From: "Richard Nyberg" > Couldn't the files in /usr/local/etc/rc.d use /etc/rc.conf > for configuration? Ie. for the openldap21 port the rc file > could check for slapd_enable and slapd_flags in /etc/rc.conf. > > This would make it easier to have port installations > in distributed filesystems like AFS. Maybe you have > many computers with the same port installation but > you only want one to start slapd. It would also > make system configuration more coherent. > > I'm thinking something like, but maybe less complex than, > /etc/rc.d in CURRENT. What do you think? > The addition of *_enable variables can be easily done with RC_NG, and a few minor changes to the existing rc.d scripts. I have already converted my ports to use a combination of the old rc.d and the new RC_NG system: Port Script *_enable security/cyrus-sasl cyrus_pwcheck.sh both saslauthd1.sh both www/apache13-fp apache.sh RC_NG only NOTE: The apache.sh script does work on <5.x, but it doesn't support the apache_enable variable in the non-RC_NG case. The thing is that the combined RC_NG/pre-RC_NG rc.d script has to be designed to run under FreeBSD 5.x+ (with rc.subr) and FreeBSD < 5.x (without rc.subr) as follows: if [ -f /etc/rc.subr ] ; then # RC_NG rc.d script . /etc/rc.subr : - Rcng style rc.d script else # pre-RC_NG rc.d scipt source rc.conf files (${prefix}/etc/rc.conf.d/scriptname, /etc/rc.conf, /etc/rc.conf.d/scriptname) case "$scriptname_enable" [Yy][Ee][Ss]) old script for pre rcng systems ;; *) rc=0 ;; esac exit $rc fi RC_NG needs a new function added to rc.subr (load_local_rc_config), this function loads the rc.conf style files as shown above. For this function see PR 44800: http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/44800 This PR also has links to other PRs where I had converted several ports scripts to a combined RC_NG/pre-RC_NG rc.d script. Scot To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message