Date: Thu, 14 Jun 2001 22:03:32 +0300 From: Peter Pentchev <roam@orbitel.bg> To: "Karsten W. Rohrbach" <karsten@rohrbach.de>, Danny Braniss <danny@cs.huji.ac.il>, freebsd-hackers@FreeBSD.ORG Subject: Re: rc, was: Re: Plan to import NetBSD rc system Message-ID: <20010614220332.A71730@ringworld.oblivion.bg> In-Reply-To: <20010614205916.D49807@mail.webmonster.de>; from karsten@rohrbach.de on Thu, Jun 14, 2001 at 08:59:16PM %2B0200 References: <roam@orbitel.bg> <E15ARsN-00062o-00@sexta.cs.huji.ac.il> <20010614201927.D729@ringworld.oblivion.bg> <20010614205916.D49807@mail.webmonster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010614220332.A71730>
