From owner-freebsd-arch@FreeBSD.ORG Tue Apr 29 10:03:29 2003 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 36A2D37B4C7 for ; Tue, 29 Apr 2003 10:03:28 -0700 (PDT) Received: from mail.westbend.net (ns1.westbend.net [216.47.253.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2681343F93 for ; Tue, 29 Apr 2003 10:03:27 -0700 (PDT) (envelope-from hetzels@westbend.net) Received: from Admin02 (admin02.westbend.net [216.47.253.19]) by mail.westbend.net (8.12.9/8.12.9) with SMTP id h3TH3JdR002361; Tue, 29 Apr 2003 12:03:23 -0500 (CDT) (envelope-from hetzels@westbend.net) Message-ID: <008401c30e71$3fade480$13fd2fd8@Admin02> From: "Scot W. Hetzel" To: "Peter Pentchev" References: <20030426154030.M13476@znfgre.qbhto.arg> <009001c30dbc$684a2c10$13fd2fd8@Admin02> <20030429122242.GB680@straylight.oblivion.bg> Date: Tue, 29 Apr 2003 12:03:21 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 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 cc: freebsd-rc@yahoogroups.com cc: freebsd-arch@freebsd.org Subject: Re: Removal of the old rc system from -current 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: Tue, 29 Apr 2003 17:03:29 -0000 From: "Peter Pentchev" > From "Scot W. Hetzel" >> I started porting my ports rc scripts to work on both rcNG and rcOG systems. >>In this process I found the ideal solution for the ports rc.d script: >> >> 1. define default port variables in the script >> 2. check for /etc/rc.subr >> a. if rc.subr exists, use rcNG style >> b. if rc.subr not exists >> 1. source /etc/defaults/rc.conf (or /etc/rc.conf) >> 2. use rcOG style > >Actually, this ought to be more like: >b. if rc.subr does not exist >1. source /etc/defaults/rc.conf >2. if the source_rc_confs function exists, execute it >3. if the source_rc_confs function does not exist, > try to emulate it by checking for the files listed > in the rc_conf_files variable and sourcing them if > they exist. This is what I have in the rcOG portion of the script to bring in the rc.conf settings: # Suck in the configuration variables. if [ -z "${source_rc_confs_defined}" ]; then if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi fi Any changes I should make to it? Scot