Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[udev] rfkill oscillation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
yew
n00b
n00b


Joined: 19 Jul 2011
Posts: 9

PostPosted: Wed Jul 20, 2011 5:19 am    Post subject: [udev] rfkill oscillation Reply with quote

I have a ThinkPad with both switch (hard) and hotkey (soft) rfkill controls, and I'm trying to get udev to start and stop net.wlan0 in response to rfkill events.

10-rfkill.rules:

SUBSYSTEM=="rfkill", ATTR{type}=="wlan", RUN+="/etc/udev/rfkill"


/etc/udev/rfkill:

#!/bin/bash

if [ "$RFKILL_STATE" = 1 ]; then
        /etc/init.d/net.wlan0 start
else # state is 0 or 2
        /etc/init.d/net.wlan0 stop
fi


The above (mostly from elsewhere on the forum) works perfectly if I flip the switch, but if I press the hotkey it causes net.wlan0 to flicker on and off rapidly. udevadm monitor --kernel --property prints a stream of events changing RFKILL_STATE from 1 to 0 and back again.

Any ideas?

Edit: I'm posting this here because it seems to be primarily a udev issue. Sorry if it should be under Networking and Security...
Back to top
View user's profile Send private message
ultraincognito
Guru
Guru


Joined: 03 Jun 2011
Posts: 346
Location: Ukraine

PostPosted: Wed Jul 20, 2011 5:42 am    Post subject: Reply with quote

This is a normal. You can make blocking one hotkey for few seconds using temporary file.
Back to top
View user's profile Send private message
yew
n00b
n00b


Joined: 19 Jul 2011
Posts: 9

PostPosted: Wed Jul 20, 2011 5:56 am    Post subject: Reply with quote

Normal? The hotkey normally only sends one event when pressed, setting RFKILL_STATE to 0 or 1 as appropriate...
Back to top
View user's profile Send private message
yew
n00b
n00b


Joined: 19 Jul 2011
Posts: 9

PostPosted: Thu Jul 21, 2011 1:55 pm    Post subject: Reply with quote

Any further advice? I confess, if stopping net.wlan0 is somehow unblocking the wireless radios I've no idea of how.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum