Date: Sun, 25 Mar 2007 23:03:38 -0400 From: Kevin Brunelle <kruptos@mlinux.org> To: freebsd-questions@freebsd.org Cc: Jack Stone <antennex@hotmail.com> Subject: Re: rc.d scripts Message-ID: <200703252303.39002.kruptos@mlinux.org> In-Reply-To: <BAY125-F17AD6981386EBE50B44E82CC680@phx.gbl> References: <BAY125-F17AD6981386EBE50B44E82CC680@phx.gbl>
next in thread | previous in thread | raw e-mail | index | archive | help
> >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. It is actually a non-trivial thing to make something run last. It seems like it should be easy but the system doesn't work that way. 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. You could edit /etc/rc and add a skip for dhclient (to prevent it from being run) and then a couple lines to get just it (with rcorder -k) at the very end of /etc/rc to execute it at the very end. You would need to add a keyword declaration in /etc/rc.d/dhclient It's extremely non-standard but if absolutely required, it would work. Or there probably are other ways. Still, the exact order of scripts [under the current system] is not meant to be fixed and static. It is meant to be flexible so things can be added and removed without worry. -Kevin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703252303.39002.kruptos>