From owner-freebsd-questions@FreeBSD.ORG Mon Mar 26 16:00:08 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9A3016A40A for ; Mon, 26 Mar 2007 16:00:08 +0000 (UTC) (envelope-from fbsd06@mlists.homeunix.com) Received: from mxout-03.mxes.net (mxout-03.mxes.net [216.86.168.178]) by mx1.freebsd.org (Postfix) with ESMTP id 93FCC13C469 for ; Mon, 26 Mar 2007 16:00:05 +0000 (UTC) (envelope-from fbsd06@mlists.homeunix.com) Received: from gumby.homeunix.com (unknown [87.81.140.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTP id 63125519CD for ; Mon, 26 Mar 2007 12:00:04 -0400 (EDT) Date: Mon, 26 Mar 2007 17:00:01 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20070326170001.0a8c2127@gumby.homeunix.com> In-Reply-To: <200703252303.39002.kruptos@mlinux.org> References: <200703252303.39002.kruptos@mlinux.org> X-Mailer: Claws Mail 2.8.1 (GTK+ 2.10.11; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: rc.d scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2007 16:00:08 -0000 On Sun, 25 Mar 2007 23:03:38 -0400 Kevin Brunelle 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.