From owner-freebsd-hackers Thu Jun 14 12: 5: 1 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 288C037B406 for ; Thu, 14 Jun 2001 12:04:56 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 71773 invoked by uid 1000); 14 Jun 2001 19:03:32 -0000 Date: Thu, 14 Jun 2001 22:03:32 +0300 From: Peter Pentchev To: "Karsten W. Rohrbach" , Danny Braniss , freebsd-hackers@FreeBSD.ORG Subject: Re: rc, was: Re: Plan to import NetBSD rc system Message-ID: <20010614220332.A71730@ringworld.oblivion.bg> Mail-Followup-To: "Karsten W. Rohrbach" , Danny Braniss , freebsd-hackers@FreeBSD.ORG References: <20010614201927.D729@ringworld.oblivion.bg> <20010614205916.D49807@mail.webmonster.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010614205916.D49807@mail.webmonster.de>; from karsten@rohrbach.de on Thu, Jun 14, 2001 at 08:59:16PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jun 14, 2001 at 08:59:16PM +0200, Karsten W. Rohrbach wrote: > Peter Pentchev(roam@orbitel.bg)@2001.06.14 20:19:27 +0000: > > OK, and what do I do if I want to manually start/stop the service later, > > and it needs variables defined in /etc/rc.conf{,local} ? > > if [ x${_RC_CONF} != x1 ]; then . /etc/rc.conf; fi > > in the beginning of the local startup script? > if it really requires it, it could plainly source it in the beginning, > or selectively using the above if statement when /etc/defaults/rc.conf > would do _RC_CONF=1; export _RC_CONF > > that's not a very good idea, but it would - at least - fix the behaviour > to be the right way. please read on... Not really; it's a great start, but something like.. if [ -z "$_RC_CONF" ]; then . /etc/defaults/rc.conf if type source_rc_confs | fgrep "shell function" > /dev/null; then source_rc_confs else rc_conf_files=${rc_conf_files-'/etc/rc.conf /etc/rc.conf.local'} for i in $rc_conf_files; do if [ -r "$i" ]; then . "$i" fi done fi _RC_CONF=1 # just in case.. fi ..would do the trick better :) G'luck, Peter -- I am not the subject of this sentence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message