question about ordering of lines in rc.conf

Paul Schmehl pauls at
Sun Dec 9 09:58:43 PST 2007

--On December 9, 2007 5:31:59 PM +0000 Pollywog <lists-fbsd at> 

> 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.
> 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?
> I solved the problem I was having with jabberd but in a different way.
/etc/rc.conf is parsed by the daemon's startup script.  So, the order of 
things in /etc/rc.conf does not determine which daemon is started first. 
That is done in /etc/rc.d and /usr/local/etc/rc.d.  Daemons are started in 
alphabetical order unless the startup script is preceded by a number but 
they also honor the PROVIDE and REQUIRE keywords which determines what has 
to start before a daemon can be started.

So, if you need a daemon to start before another daemon, rename the 
startup script to begin with a number.

See man 8 rc, man 8 rcorder, especially this:

 The scripts within each directory are executed in lexicographical
         order.  If a specific order is required, numbers may be used as a
         prefix to the existing filenames, so for example would be
         executed before; without the numeric prefixes the opposite
         would be true.

Paul Schmehl (pauls at
Senior Information Security Analyst
The University of Texas at Dallas

More information about the freebsd-questions mailing list