# [solved] New udev starts wireless too early

## schiotz

I have an Intel 2200 wireless card in my laptop.  Previously, to get it to work I had to build support as a kernel module, and let coldplug load it.  I started coldplug in the default runlevel, because if I start it in the boot runlevel, the network would not come up.

Now udev loads the module (coldplug is gone), and it does not work, perhaps because it is started too early.  If I try to restart net.eth1 I cannot, because wpa_supplicant is already running (my network uses WPA encryption).  I have to manually kill wpa_supplicant, and then start net.eth1.  

How do I get this to work at boot time?

/JakobLast edited by schiotz on Fri Dec 15, 2006 12:17 pm; edited 1 time in total

----------

## PaulBredbury

Try removing hotplug  :Question: 

----------

## schiotz

 *PaulBredbury wrote:*   

> Try removing hotplug 

 

Then my USB devices will stop working  :Smile: 

Anyway, the firmware *is* loaded, the problem is that udev starts net.eth1 while we are still in the boot runlevel, and the net scripts will only work after the boot runlevel have completed.

/Jakob

----------

## schiotz

 *PaulBredbury wrote:*   

> Try removing hotplug 

 

I my arrogance, I was quick to decide that your solution could not work.  In my desperation, I tried anyway   :Very Happy:   :Very Happy: 

It did fix my wireless (I just had to add net.eth1 to the default runlevel).  But I lost my the ability to use USB disks, /dev/sda1 no longer appears when I plug it in.

----------

## PaulBredbury

For usb disks, write udev rules for them, and check that hotplug-base is installed.

----------

## schiotz

 *PaulBredbury wrote:*   

> For usb disks, write udev rules for them, and check that hotplug-base is installed.

 

Ouch!  Do I have to understand and write udev stuff  :Sad:   That is a major step backwards, considering that it used to just work.  At least my USB printer still works without problems.

Thanks for all your help!

BTW, I do not think it is bug 147006 that you mention above, the firmware was definetely loaded correctly.  It is as if udev starts wpa_supplicant, which tries to start the net, which fails (perhaps due to the runlevel still being boot), and then wpa_supplicant keeps running preventing restarts of the net.

/Jakob

----------

## schiotz

 *PaulBredbury wrote:*   

> For usb disks, write udev rules for them, and check that hotplug-base is installed.

 

I cannot.  Nothing appears under /sys/block when I stick in the USB disk, so I do not know how to get the info needed to write the udev rule (and anyway, should udev not make a /dev/sda if there is no explicit rule?)

hotplug-base *is* installed.

----------

## baeksu

Can't you use /etc/conf.d/rc to stop the service from being started by things happening in /dev?

There's an option RC_PLUG_SERVICES, you can add "!net.eth1" there and it should stop it from hotplug-starting. You can start it at default level with rc-update still. At least I think it should work.

And writing udev rules is not so difficult, basically it's enough to know the model or serial number of the devices you use. But devices you haven't used will still get normal random places in /dev, though.

----------

## schiotz

 *baeksu wrote:*   

> Can't you use /etc/conf.d/rc to stop the service from being started by things happening in /dev?
> 
> There's an option RC_PLUG_SERVICES, you can add "!net.eth1" there and it should stop it from hotplug-starting. You can start it at default level with rc-update still. At least I think it should work.
> 
> And writing udev rules is not so difficult, basically it's enough to know the model or serial number of the devices you use. But devices you haven't used will still get normal random places in /dev, though.

 

Thanks for your advice.  The problem with the udev rule is that no new device appeared.  Your suggestion about RC_PLUG_SERVICES is really good, I will keep it in mind.  However, I just invented a more clumsy workaround, preparing to try it out I remerged hotplug.  Lo and behold! Everything suddently worked correctly.   :Very Happy: 

Somehow, the real problem must have been a defective hotplug installation, perhaps a left-over file in /etc/hotplug, which I removed by hand when I uninstalled it.

Thanks to you and PaulBredbury for your help!

/Jakob

----------

## PaulBredbury

 *schiotz wrote:*   

> Nothing appears under /sys/block when I stick in the USB disk

 

What about /sys/class? Sounds like a bit of sleuthing is required. Run:

```
udevcontrol log_priority=debug
```

Then plug in the disk, and see the messages in /var/log/messages. That will tell you what udev is doing.

----------

## schiotz

 *PaulBredbury wrote:*   

>  *schiotz wrote:*   Nothing appears under /sys/block when I stick in the USB disk 
> 
> What about /sys/class? Sounds like a bit of sleuthing is required. Run:
> 
> ```
> ...

 

Thanks for the advice.  I think that now that it works I will leave it at that until it (or something else) breaks again.  But I will remember this trick so I can figure out what udev does next time I need it.

Thanks for everything!

/Jakob

----------

