Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Dec 2007 18:12:42 +0000
From:      Daniel Bye <freebsd-questions@slightlystrange.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: question about ordering of lines in rc.conf
Message-ID:  <20071209181242.GB1123@torus.slightlystrange.org>
In-Reply-To: <200712091732.02238.lists-fbsd@shadypond.com>
References:  <200712091732.02238.lists-fbsd@shadypond.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--98e8jtXdkpgskNou
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Dec 09, 2007 at 05:31:59PM +0000, Pollywog wrote:
> It appears that the order of the *_enable=3D"YES" lines in /etc/rc.conf i=
s=20
> important.  I am looking at a HOWTO for HPLIP in which the author suggest=
s=20
> adding two lines in a certain order.

Which two lines? It shouldn't matter - any script that relies on variables
in /etc/rc.conf should read the entire file for anything it's interested
in *before* doing anything with those values. The first line of any
such script should be something like

=2E /etc/rc.subr

/etc/rc.subr defines a function called load_rc_config() which is responsible
for reading /etc/rc.conf (among other things), and making all the
variables in /etc/rc.conf available to the calling script. It (the calling
script) is then responsible for checking the values of any it is interested
in.

Some older style rc scripts don't source /etc/rc.subr or call the=20
load_rc_config function, but handle finding their settings in a different
way, but one which still finds all the necessary settings before doing
any processing.

>=20
> Since I recently had a problem with jabberd starting before myslq was rea=
dy to=20
> accept connections and I just found that  jabberd_enable=3D"YES" precedes=
=20
> mysql_enable=3D"YES" in my rc.conf, I am wondering whether order is impor=
tant.
> Can anyone provide an answer?

No - it is the values of the rcorder(8) block in each script that determines
the order in which things are run. For older style scripts that don't=20
conform to the rcorder standard, the name of the file determines when
it is run, not the order that variables are defined in /etc/rc.conf.

Dan

--=20
Daniel Bye
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \

--98e8jtXdkpgskNou
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD4DBQFHXDAaixf5fBYiFmoRAmgtAJilICfD4X4VnMxXCizZuAfjPTKnAJ9mGi+J
NyJ3uAlQ2HDjlJQDJpmPEw==
=CGdZ
-----END PGP SIGNATURE-----

--98e8jtXdkpgskNou--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071209181242.GB1123>