seppelrockt asked on the Gentoo Forums about integrating xsupplicant with our network scripts seeing as baselayout has no support for it. As I don’t have anything xsupplicant can work with, I never got around to writing a module for it. However, in his last paragraph he said he wanted to change to wpa_supplicant for auth over the LAN.

My first thought was “WTF?” as wpa_supplicant is just for associating with an AP and then doing encryption / authentication, so I told him so! Lo and behold, the cheeky git had the nerve to tell me I was wrong. :? So I checked out the latest wpa_supplicant and it did indeed have an option to work over a wired interface :O

So I set about the task of fixing up the wpa_supplicant module, which was much tricker than I thought as you could mix ifplugd or netplug into the equation. I’ve always worked under the assumption that you’ll only ever have one daemon controlling the interface (netplug, ifplugd or wpa_supplicant- dhcp daemons don’t), hence everything worked fine with the IN_BACKGROUND env var. Now we had two daemons controlling the same interface :jawdrop:

Luckily, thanks to a recent feature addition, we know which daemons are started by which init script- but more importantly the order they are started in. This means that when netplug detects that a cable has been removed, wpa_supplicant can now stop even though the init script was stopped from the background. We know this, because wpa_supplicant stops when not IN_BACKGROUND or it wasn’t the first daemon started 8)

If you need to try out this wonderous beast, you can download the patch for baselayout-1.12.0_pre9-r1.

EDIT: Patch updated 19:24 BST today- it works on wireless cards again!