From owner-freebsd-mobile@FreeBSD.ORG Tue Jul 24 23:42:45 2007 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67A5616A417 for ; Tue, 24 Jul 2007 23:42:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with SMTP id 1F49513C45B for ; Tue, 24 Jul 2007 23:42:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 15463 invoked by uid 399); 24 Jul 2007 23:42:44 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTP; 24 Jul 2007 23:42:44 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <46A68E72.8040607@FreeBSD.org> Date: Tue, 24 Jul 2007 16:42:42 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.5 (X11/20070723) MIME-Version: 1.0 To: John Baldwin References: <20070718181039.GA1845@rebelion.Sisis.de> <200707231727.18986.jhb@freebsd.org> <46A596B3.1080506@FreeBSD.org> <200707241149.30767.jhb@freebsd.org> In-Reply-To: <200707241149.30767.jhb@freebsd.org> X-Enigmail-Version: 0.95.1 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Henrik Brix Andersen , freebsd-rc@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: wpa_supplicant && and no ctrl_interface for wpa_cli X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2007 23:42:45 -0000 [ I'm adding freebsd-rc for a little more review. The short version is that on Henrik's system the local rc.d files cause rcorder to put cleanvar after netif, which wipes out some important wpa_supplicant stuff. ] John Baldwin wrote: > On Tuesday 24 July 2007 02:05:39 am Doug Barton wrote: >> John Baldwin wrote: >>> On Monday 23 July 2007 05:00:06 pm Henrik Brix Andersen wrote: >>>> On Mon, Jul 23, 2007 at 02:56:27PM -0400, John Baldwin wrote: >>>>> Are you sure? In my output of rcorder, cleanvar gets run before netif >>> (which >>>>> is what kicks off wpa_supplicant). Also, when I looked, other files >>>>> under /var/run that should have been toasted if cleanvar was running > after >>>>> netif were still present. >>>> Yes, I am sure - I tested the patch before shipping it. If you add a >>>> debug 'echo' to cleanvar you can see that it removes the >>>> wpa_supplicant/* files after wpa_supplicant has run. >>> Grrr, the problem is that cleanvar is running at the wrong time then. A > real >>> fix is to figure out that ordering problem. >>> >> Henrix, can you please copy /etc/rc to its own directory, and apply >> the attached patch to it? Then please do the following: >> >> rcorder -s nostart /etc/rc.d/* > rcorder.log 2>&1 >> >> Then run the patched rc, and either send me the 4 (total) files, or >> post the results here. > > I debugged this further and found some interesting results. If I run rcorder > on just /etc/rc.d/* cleanvar gets scheduled after var, but if I run rcorder > on /etc/rc.d/* and my scripts in /usr/local/etc/rc.d, I get a different order > and cleanvar is just before pflog (which REQUIREs cleanvar). John, This is expected (and technically a feature), that's why I asked Henrik to try that patch for rc. > Making 'netif' REQUIRE cleanvar does seem to fix this, I've looked over what you and Henrik posted, and what I have on my system (with just a few local rc.d files) and I agree with you. I don't see anything else between var and netif on any of the three rcorder lists that needs/interacts with the directories that are cleaned by cleanvar, so doing what you suggested sounds like the way to go. > but having rcorder give different > lists is troubling considering we invoke it twice. Would hate to skip a > script and/or run one twice because it moved before or after $early_divider. > In my case it seems that no scripts prior to $early_divider were affected. We work pretty hard to make sure that doesn't happen, but you're right, it isn't impossible. FYI, what happens most often is that something doesn't get run because it moves before $early_late_divider in the second run. When it does happen (or when something like Henrik's problem happens) we have to take another look at the REQUIRE lines to make sure it can't happen again. The reason we try to leave things as loose as possible is so that local scripts (both from ports and from users) CAN affect the rcorder, since in many cases they need to. Of course this gives the port authors a pretty big responsibility to make sure that they don't break things. (The other reason we don't like to make gratuitous changes is the "if it's not broken, don't fix it" rule.) I'm in favor of your patch. Unless I hear from you otherwise (or unless someone on -rc opposes it) I'll assume you're going to commit it. If you'd prefer that I do it, just let me know. Henrik, It would of course be good if you could confirm this works for you, but I don't see why it wouldn't. Doug > You can find my rcorder outputs at http://www.FreeBSD.org/~jhb/rcfun/ > > 'one' is 'rcorder -s nostart /etc/rc.d/*' before I patched netif > 'two' is 'rcorder -s nostart /etc/rc.d/* /usr/local/etc/rc.d/' before > I patched netif (where are all the rcNG style scripts) > 'three' is 'rcorder -s nostart /etc/rc.d/* /usr/local/etc/rc.d/' after > I patched netif. > > Patch to netif: > > Index: netif > =================================================================== > RCS file: /usr/cvs/src/etc/rc.d/netif,v > retrieving revision 1.22 > diff -u -r1.22 netif > --- netif 9 Feb 2007 12:11:26 -0000 1.22 > +++ netif 24 Jul 2007 11:59:40 -0000 > @@ -26,7 +26,7 @@ > # > > # PROVIDE: netif > -# REQUIRE: atm1 ipfilter mountcritlocal serial sppp sysctl > +# REQUIRE: atm1 cleanvar ipfilter mountcritlocal serial sppp sysctl > # KEYWORD: nojail > > . /etc/rc.subr > -- This .signature sanitized for your protection