Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2007 16:42:42 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Henrik Brix Andersen <henrik@brixandersen.dk>, freebsd-rc@freebsd.org, freebsd-mobile@freebsd.org
Subject:   Re: wpa_supplicant && and no ctrl_interface for wpa_cli
Message-ID:  <46A68E72.8040607@FreeBSD.org>
In-Reply-To: <200707241149.30767.jhb@freebsd.org>
References:  <20070718181039.GA1845@rebelion.Sisis.de>	<200707231727.18986.jhb@freebsd.org> <46A596B3.1080506@FreeBSD.org> <200707241149.30767.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[ 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/<mumble>' before 
> I patched netif (where <mumble> are all the rcNG style scripts)
> 'three' is 'rcorder -s nostart /etc/rc.d/* /usr/local/etc/rc.d/<mumble>' 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46A68E72.8040607>