From owner-freebsd-questions@FreeBSD.ORG Tue Feb 5 10:21:31 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE412D5C for ; Tue, 5 Feb 2013 10:21:31 +0000 (UTC) (envelope-from tomek.cedro@gmail.com) Received: from mail-qe0-f45.google.com (mail-qe0-f45.google.com [209.85.128.45]) by mx1.freebsd.org (Postfix) with ESMTP id 9A25BB27 for ; Tue, 5 Feb 2013 10:21:30 +0000 (UTC) Received: by mail-qe0-f45.google.com with SMTP id b4so3325335qen.32 for ; Tue, 05 Feb 2013 02:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:date:x-google-sender-auth:message-id :subject:from:to:content-type; bh=ePW+Dtkei5yBisYovpWi0+OIYnJ3g/9JOY6noMxHU0A=; b=vXaMsfuMem04hylpD9RpS7ntILLl4SSat6HjZZm4OpJzoxyExuQQFg+iQTsze51N26 5bImWyrmA6doZ9bDvfrzb4frOBKUMoUzumMxzAeKDhBuR4jzlQVwohVg66WpuRhgLLOe L/NK2VUMA7nLS3s+J2Fyh0lm3VEOb8xPor4mDm7Sv46P3ZrENlrzoKL2x8sIbflgUq0x XnyhPtlQkhv+SnjR9PqGzm7eDJ0lBru77/fQObcuLnVM981l6bE5ti7oj3d5S15Y+CdV pJ8FY0RlIGG5u3uqllZt+2YG2OzJqTXWizyG+EiN/KjREuXDyfZEFl1nnV9lnrJCdp+c 5qhw== MIME-Version: 1.0 X-Received: by 10.49.72.136 with SMTP id d8mr22744732qev.62.1360059247265; Tue, 05 Feb 2013 02:14:07 -0800 (PST) Sender: tomek.cedro@gmail.com Received: by 10.49.71.204 with HTTP; Tue, 5 Feb 2013 02:14:07 -0800 (PST) Date: Tue, 5 Feb 2013 11:14:07 +0100 X-Google-Sender-Auth: UcTNTTP6lSFqnI21m0CKMRv03g8 Message-ID: Subject: devd wlan wpa From: CeDeROM To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 10:21:31 -0000 Hello :-) I want to setup wpa_supplicant to start after wlan0 interface gets up. The rc.conf ifconfig_wlan0="WPA DHCP" does the job only at boot. When I get the interface down I need to start everything by hand, which is a bit annoying when I test a lot and need to switch between Ethernet and WiFi interfaces very often. I have tried to write devd rule: notify 0 { match "system" "IFNET"; match "subsystem" "wlan[0-9]+"; match "type" "LINK_UP"; media-type "802.11"; match "device-name" "wlan[0-9]+"; action "/usr/sbin/wpa_supplicant -i $device-name -c /etc/wpa_supplicant.conf -B"; }; But there goes the chicken-egg problem - I want to run wpa_supplicant on LINK_UP event that occurs when Media Status is "connected", but to get that "connected" status I need to run wpa_supplicant first, so capabilities of devd are not enough in this case, or I miss something? Is there any distinction between LINK_UP and IF_UP? Any hints appreciated :-) Tomek -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info