question about ordering of lines in rc.conf

Daniel Bye freebsd-questions at
Sun Dec 9 10:12:46 PST 2007

On Sun, Dec 09, 2007 at 05:31:59PM +0000, Pollywog wrote:
> It appears that the order of the *_enable="YES" lines in /etc/rc.conf is 
> important.  I am looking at a HOWTO for HPLIP in which the author suggests 
> 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

. /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

Some older style rc scripts don't source /etc/rc.subr or call the 
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.

> Since I recently had a problem with jabberd starting before myslq was ready to 
> accept connections and I just found that  jabberd_enable="YES" precedes 
> mysql_enable="YES" in my rc.conf, I am wondering whether order is important.
> 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 
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.


Daniel Bye
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list