From owner-freebsd-questions@FreeBSD.ORG Wed Mar 10 00:54:52 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6385A16A4CE for ; Wed, 10 Mar 2004 00:54:52 -0800 (PST) Received: from dyer.circlesquared.com (host217-45-219-83.in-addr.btopenworld.com [217.45.219.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF42743D1D for ; Wed, 10 Mar 2004 00:54:51 -0800 (PST) (envelope-from peter@circlesquared.com) Received: from circlesquared.com (localhost.petanna.net [127.0.0.1]) i2A8w01J077758; Wed, 10 Mar 2004 08:58:11 GMT (envelope-from peter@circlesquared.com) Message-ID: <404ED898.1040304@circlesquared.com> Date: Wed, 10 Mar 2004 08:58:00 +0000 From: Peter Risdon User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5b) Gecko/20031102 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <404E98CB.6060203@ste-land.com> <404ED077.50407@circlesquared.com> In-Reply-To: <404ED077.50407@circlesquared.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: "Shaun T. Erickson" Subject: Re: rc script timing issues? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2004 08:54:52 -0000 Peter Risdon wrote: > Shaun T. Erickson wrote: > >> On 5.2.1-RELEASE-p1, in /usr/local/etc/rc.d, I have scripts that >> start my MySQL database, and that start my Courier-IMAP daemons. When >> the scripts for courier run, one of the first things they do is start >> authdaemond, which should fire up several authdaemond.mysql processes >> and then they start the imap daemons. >> >> On reboot, the imap daemons are running, but the authdaemond.mysql >> processes aren't. If I stop the imap script, and re-run it, >> everything starts up just fine. >> >> I suspect that the database isn't getting started before the imap >> scripts are run. So, I moved the database startup script to >> /etc/rc.d, but on reboot, the database wasn't started. I had hoped >> moving it to /etc/rc.d might start it earlier in the boot process. >> >> Suggestions? TIA. > > > From man 8 rc.d: > > 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. > > You might be able to see this if you've installed, say, mysql-client > which uses a script in /usr/local/etc/rc.d called 000.mysql-client.sh > - the 000. forces an early startup. So I suggest you're better off > moving the scripts back to /usr/local/etc/rc.d and prefixing them with > numerals to get the startup order correct. One small note - the startup script for mysql-client is prefixed with 000. but the one for mysql-server is not prefixed by a numeral. The mysql client has to start before the server. You'll need to prefix mysql-server.sh with a numeral but it must be > 000. PWR.