From owner-freebsd-wireless@FreeBSD.ORG Sat Nov 2 19:13:33 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6FB4FB72 for ; Sat, 2 Nov 2013 19:13:33 +0000 (UTC) (envelope-from clutton@zoho.com) Received: from sender1.zohomail.com (sender1.zohomail.com [72.5.230.95]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBC423F7 for ; Sat, 2 Nov 2013 19:13:33 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:from:to:in-reply-to:references:content-type:date:message-id:mime-version; b=bVtnquAakUMHUq0+83oLJOwaFaN1aZeeyOtv1XAeGWZsoLEkfs2aDp5ZZee4awtnpIL5iQd3WWI0 VWuw90+LnncGDWdnWZTV4YVHe8+P8MwXgD7DaZbGi38npgERHgbe Received: from [192.168.11.5] (213.111.120.236 [213.111.120.236]) by mx.zohomail.com with SMTPS id 1383419606653341.2057659007768; Sat, 2 Nov 2013 12:13:26 -0700 (PDT) Subject: Re: service netif restart [iface] runs a wpa_supplicant twice From: clutton To: freebsd-wireless@freebsd.org In-Reply-To: References: <1382572583.1862.39.camel@eva02.mbsd> <1382589020.1846.36.camel@eva02.mbsd> <1383331203.12614.1.camel@eva02.mbsd> <1383336004.13657.18.camel@eva02.mbsd> <1383338117.13657.53.camel@eva02.mbsd> <1383382815.31973.1.camel@eva02.mbsd> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-n+s/DsaiIaKH72GPhAGc" Date: Sat, 02 Nov 2013 21:13:16 +0200 Message-ID: <1383419596.3253.42.camel@eva02.mbsd> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-Zoho-Virus-Status: 1 X-ZohoMail: Ss SS_10 UW UB UW UB SGR3_1_25103_328 X-ZohoMail-Owner: <1383419596.3253.42.camel@eva02.mbsd>+zmo_0_ X-ZohoMail-Sender: 213.111.120.236 X-ZohoMailClient: External X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2013 19:13:33 -0000 --=-n+s/DsaiIaKH72GPhAGc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2013-11-02 at 10:00 -0700, Adrian Chadd wrote: > right, this makes it clearer. >=20 > What about: >=20 > * the wpa_supplicant rc script only starts/stops one wpa_supplicant insta= nce > * upon ethernet / wlan clone creation, use interface_add to add the > interface to wpa_supplicant > * upon ethernet / wlan clone destruction, use interface_remove >=20 > how's that sound? >=20 >=20 > -adrian Sounds nice, but firstly we need to figure out this case, and then we can do adding/removing/whatever Without fixing that, it would be possible to see adding/removing/whatever twice. How to reproduce: 1) put debug info into rc.d/wpa_supplicant, a =C2=ABtoto=C2=BB looks very informative! =E2=86=911 ~ =E2=86=92 diff -u /usr/src/etc/rc.d/wpa_supplicant /etc/rc.d/w= pa_supplicant --- /usr/src/etc/rc.d/wpa_supplicant 2013-06-19 01:06:53.911196741 +0300 +++ /etc/rc.d/wpa_supplicant 2013-11-02 20:42:02.556222618 +0200 @@ -34,6 +34,8 @@ driver=3D"bsd" fi =20 +echo toto >> /tmp/toto + load_rc_config $name =20 command=3D${wpa_supplicant_program} zsh: exit 1 diff -u /usr/src/etc/rc.d/wpa_supplicant /etc/rc.d/wpa_supplicant =E2=86=911 ~ =E2=86=92=20 2) then: service netif restart 3) then: cat /tmp/toto, how many totos do you see? 4) if you are lucky like I am, you can even observe something like this: root 15038 0.0 0.1 21596 6100 - Ss 8:42pm 0:00.16 /usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_supplicant.conf -D bsd -P /var/run/wpa_supplicant/wlan0.pid root 15077 0.0 0.1 21596 6112 - Ss 8:42pm 0:00.12 /usr/sbin/wpa_supplicant -s -B -i wlan0 -c /etc/wpa_supplicant.conf -D bsd -P /var/run/wpa_supplicant/wlan0.pid What was happened? netif tries to setup wlan0 (clone, wpa, dhcp, etc), when wlan0 interface occurs, devd runs another copy of netif. --=-n+s/DsaiIaKH72GPhAGc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAABAgAGBQJSdU7MAAoJECNkWbjnbjui98sQAIYwzxdGjOMUFcSctjUcYrT0 2oMtA7/q2s6gCKlmNvamd76v5onat2Exw8RKkRbaFWNltJgEx/N5N3im8LGyGzg8 Xdps6Tm5+nUBKcRPe70p/e4UQCcl1smWXbT2wrtVtTE4PJ2IE6SiVKiqcucyzYD+ 8xnyVgDiWDsytQob89E4Fpj6/0YtzEca8Z7SwycOAFjvO6cQ+rOKEqkHdyK7hN1r o4fsVWGqP1jP59Qm3eofyZWpGqj2ZOZnJXSvfsCPHH7EqPexULWc9TclueFmveWJ Hdw93ro5YR4E6GcUfMZuOpGPHszom3alHpi7dnNpBqr2ZCFC+DNPawQoYJRpQIP9 rX7hophzacx4vS+VcxwHupS1YSC5uYAlnqTTtUZfyBi0CwcjY1ce9rnyXF8Nx4c9 +i8tCeqLHHE0Ql9A1UqTWESNyX8UHYK7Gm4PzSh38c0O6nmJ5Dn/Gr5Nui0hiWgz b0Y+WaJcUmm9rOCapkbBWO6wsVZ0zy7alQkgkk+T2y8pQIjpdRfL4YQeGfBmlPFW mXHtl2Q3YcFkEbNht8TDwxxe83Cg7U+w0ZFBhmEVgpnNBtkoLFzI7C3JeRYm3xaM p3T2qlCixKZogXSTLmLDZTzaCAAoFu3jnCEnT1/xo2KWFNZ5yMctMlVX8AJXXYWz uGw7RwhUvhghIkKITPJR =9ubh -----END PGP SIGNATURE----- --=-n+s/DsaiIaKH72GPhAGc--