rc.d scripts

RW fbsd06 at mlists.homeunix.com
Mon Mar 26 16:00:08 UTC 2007


On Sun, 25 Mar 2007 23:03:38 -0400
Kevin Brunelle <kruptos at mlinux.org> wrote:

> > >Does anyone know how to make a script in /etc/rc.d run last?  For
> > >instance I want dhclient to be the last script in /etc/rc.d/ to
> > >run.  Any help is much appreciated.
> >
> > This may have already been answered by others, but I believe just
> > rename the script with a prefix of "z" for example: "zmyscript.sh"
> > or "zzmyscript" to make it very last beyond the first one with a
> > "z".
> >
> > It works for me.
> 
> I have my suspicions regarding this working as you describe.  As the
> order isn't related to the filename but to the REQUIRE tags inside
> the file.  

Correct; dictionary order applies only to old-style local scripts
in /usr/local/etc/rc.d. 

> 
> For example, adding a requirement for bgfsck (which was also last on
> my system when I did this) moved bgfsck down the list... and still
> left dhclient 4th from last.  In fact, it took the addition of:
> 
> # REQUIRE: bgfsck bsnmpd bridge bluetooth
> 
> to actually make it the last thing run.  And that is not a sure thing 
> either... as soon as the system is updated it is likely to change.

Most of the time, when people ask how to run something last, it's
because they don't  really know when it should run, and just want it
pretty late. 


More information about the freebsd-questions mailing list