From owner-freebsd-ports@FreeBSD.ORG Mon May 15 21:56:58 2006 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C940116BA58 for ; Mon, 15 May 2006 21:56:58 +0000 (UTC) (envelope-from duane@greenmeadow.ca) Received: from smtpout.eastlink.ca (smtpout.eastlink.ca [24.222.0.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2088943D60 for ; Mon, 15 May 2006 21:56:58 +0000 (GMT) (envelope-from duane@greenmeadow.ca) Received: from ip03.eastlink.ca ([24.222.10.15]) by mta01.eastlink.ca (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0IZB0047XUANFGL0@mta01.eastlink.ca> for ports@freebsd.org; Mon, 15 May 2006 18:56:47 -0300 (ADT) Received: from blk-224-199-230.eastlink.ca (HELO [192.168.0.103]) ([24.224.199.230]) by ip03.eastlink.ca with ESMTP; Mon, 15 May 2006 18:56:31 -0300 Date: Mon, 15 May 2006 18:55:37 -0300 From: Duane Whitty In-reply-to: <4468C011.2080404@rogers.com> To: Mike Jakubik Message-id: <4468F8D9.7070204@greenmeadow.ca> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAQAAA+k= References: <446696B7.1070009@rogers.com> <4466C4F3.6000101@greenmeadow.ca> <4468C011.2080404@rogers.com> User-Agent: Thunderbird 1.5.0.2 (X11/20060503) Cc: ports@FreeBSD.org Subject: Re: freeradius starts before mysql X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2006 21:57:01 -0000 Mike Jakubik wrote: > Duane Whitty wrote: >> Hi Mike, >> >> Sorry for my earlier botched attempt :) >> >> I verified that according to rc(8) scripts in >> /usr/local/etc/rc.d are processed in alphabetical >> order (lexicographical is the word I couldn't recall originally). >> >> I did some testing. >> >> I created a script /usr/local/etc/rc.d/xxxserver >> >> with the lines >> >> # PROVIDE: xxxserver >> # REQUIRE: NETWORKING SERVERS >> # BEFORE: DAEMON >> # KEYWORD: shutdown >> >> and I modified /usr/local/etc/rc.d/mysql-server with >> >> # REQUIRE: xxxserver >> # BEFORE: DAEMON >> >> >> With this I caused xxxserver to run before mysql. >> >> It doesn't -- seem -- to adversely effect mysql to start earlier >> in the boot sequence than it normally would >> >> I did test all of the above with a reboot. >> >> >> >> If in /usr/local/etc/rc.d/freeradius you change # REQUIRE: NETWORKING >> SERVERS to >> >> REQUIRE: mysql >> >> and in /usr/local/etc/rc.d/mysql-server you change >> >> # REQUIRE: LOGIN to # REQUIRE: NETWORKING SERVERS >> and add >> >> # BEFORE: DAEMON >> >> Then mysql should get started before freeradius. >> >> I'd test this out for you but as I said in my earlier off-list message >> I don't have freeradius installed. > > Thanks for the info. I will try the second method. But im finding this > rcNG stuff a little weird. If application A provides X, and > application B requires X, shouldn't A always start before B? If not, > them my understanding of "require" and "provide" is flawed i guess... > Hi, No, I don't think your understanding is flawed. The one thing you didn't seem to take into consideration is #BEFORE: When I was reading rc(8), I interpreted the LOGIN script as being a "divider" script that is called quite late. Since the MySQL script requires LOGIN it seems it doesn't start until late in the boot process. I have verified that MySQL was the last thing starting on my system if I remember correctly. REQUIRE seems to work within in a specific "script space". All scripts that REQUIRE the same "things" seem to start in alphabetical order. I'm not sure what the point in specifying # REQUIRE: NETWORKING SERVERS is: It looks to me like SERVERS runs after NETWORKING which makes specifying NETWORKING redundant. Maybe someone working on rcNG could make a more authoritative response though. Maybe the reason putting # REQUIRE: mysql is not working is that to do so MySQL would have to start earlier. But the installed script instructs MySQL to wait for LOGIN to run. My SQL can start earlier than this though with -- apparently -- no ill side effects. In rc(8) the order of the "divider" scripts is NETWORKING, SERVERS, DAEMON, and LOGIN FreeRadius is told to start before DAEMON and after SERVERS so instead tell it to start before DAEMON but after MySQL. It seems to me that in the freeradius script that # REQUIRE: mysql # BEFORE: DAEMON should work and in the mysql script # REQUIRE: SERVERS # BEFORE: DAEMON should work. Best Regards, Duane Whitty -- duane@greenmeadow.ca