From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aras Vaichas Date: Thu, 14 Aug 2008 00:09:56 +0000 Subject: Re: Bluetooth wireless activity triggers udev rule Message-Id: <48A377D4.4020800@magtech.com.au> List-Id: References: <48A25D4F.3000807@magtech.com.au> In-Reply-To: <48A25D4F.3000807@magtech.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Kay Sievers wrote: > On Wed, Aug 13, 2008 at 06:04, Aras Vaichas wrote: > >> Hi, I'm currently integrating runit and udev. I have a udev rule which >> runs my Blue-Z startup scripts when I plug in the USB BT dongle: >> >> ACTION="add", ENV{SUBSYSTEM}="bluetooth", RUN+="/usr/bin/sv up bluetooth" >> >> This works really well, cold plugging, etc. No problems. >> >> I've found an interesting quirk though. Here is the sequence of events: >> >> Computer A: I start up my system with the BT dongle inserted, the Blue-Z >> scripts are started via udev coldplugging script >> Computer B: I set up a task which searches for BT devices and tries to >> form a PPP connection >> Computer B: Detects the BT dongle on Computer A, records the address and >> forms a PPP connection >> Computer A: I disable the Blue-Z scripts # sv down bluetooth >> Computer B: Attempts to connect to A again, and sends a BT signal to >> connect ... >> Computer A: The BT dongle sends a wireless wakeup (wake-on-lan?) signal >> which causes udev to run the Blue-Z utils startup script again ... >> >> I looked at the udev events to see what was happening when Computer B >> tried to connect to Computer A. It appears that the two series of events >> are nearly identical. Can someone suggest a way for me to start the >> Blue-Z utils *only* when the USB dongle is *inserted* (or first detected). >> > > Match only on the the hci* creation events? > ACTION="add", KERNEL="hci[0-9]*", SUBSYSTEM="bluetooth", > RUN+="/usr/bin/sv up bluetooth" Yes, that works. USB Bluetooth device insertion will trigger the bluetooth scripts, but bluetooth network activity will not trigger the script. This is good. Thank you. Aras ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________