Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to configure hotplugging ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 453

PostPosted: Thu Dec 06, 2012 2:42 pm    Post subject: how to configure hotplugging ? Reply with quote

in gentoo it is possible to allow services to be hotplugged on detection of certain usb equipments.

E.g. if I set in /etc/rc.conf
rc_hotplug="net.eth1", the service net.eth1 will automatically be started when eth1 is detected by udev.

However, I cannot find the location where I can configure this behaviour.

What I want to do: I have a usb based wifi stick, and I can start the hostapd service to get an access point.

However, when someone pulls and replugs the usb wifi stick, I need the service hostapd to be restarted, not the service net.eth0.

I would expect that there is somewhere some config file that creates a link between a specific device+type and a specific service

I guess that there is some default that says

<network device> named <ethx> ==> service net.ethx

I would like to change that to
<network device> named 'usbwifi' ==> hostapd

Is there any such config file ?
Back to top
View user's profile Send private message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 453

PostPosted: Mon Dec 10, 2012 12:39 pm    Post subject: Reply with quote

I found out more about this mapping. It turns out that all mappings are hardcoded in udev. more specifically,
each time a network interafce is added or removed, the rules in /lib/udev/rules.d/90-network.rules are called.
This calls a script net.sh, which starts or stops /etc/init.d/net.$iface

=> I will have to write my own udev rule to make a map
SUBSYSTEM="net",%k="usbwifi" RUN+=start-or-stop-hostapd
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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