Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Dec 2007 11:58:47 -0600
From:      Paul Schmehl <pauls@utdallas.edu>
To:        freebsd-questions@freebsd.org
Subject:   Re: question about ordering of lines in rc.conf
Message-ID:  <7070AAA9B18DEF4507E20502@paul-schmehls-powerbook59.local>
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
--On December 9, 2007 5:31:59 PM +0000 Pollywog <lists-fbsd@shadypond.com> 
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.
>
> 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 100.foo would be
         executed before 200.bar; without the numeric prefixes the opposite
         would be true.

Paul Schmehl (pauls@utdallas.edu)
Senior Information Security Analyst
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/




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