[systemd-devel] [PATCH 1/2] wpa_supplicant: Add systemd support
Alexander E. Patrakov
patrakov at gmail.com
Tue Jul 12 09:15:53 PDT 2011
Dan Williams wrote:
[replying to both Dan and Henry in the same mail]
> On Tue, 2011-07-12 at 16:20 +0200, Henry Gebhardt wrote:
> > (To the hostap mailing list: I wasn't subscribed to this list when I
> > sent the patches, now I am. Did they reach you?)
> > On Mon, Jul 11, 2011 at 10:13:52PM +0000, Alexander E. Patrakov wrote:
> > > Henry Gebhardt wrote:
> > >
> > > > --- /dev/null
> > > > +++ b/wpa_supplicant/systemd/wpa_supplicant at .service @@ -0,0 +1,11 @@
> > > > +[Unit]
> > > > +Description=WPA supplicant daemon (interface-specific version)
> > > > +# NetworkManager users will probably want the dbus version instead.
> > > > +[Service]
> > > > +Type=simple
> > > > +ExecStart=/sbin/wpa_supplicant
> > > > -c/etc/wpa_supplicant/wpa_supplicant.conf -i%I
> > > > +[Install]
> > > > +Alias=network.target.wants/wpa_supplicant at wlan0.service
> > >
> > > This is not enough to get a working wpa_supplicant on a wired interface
> > > that uses 802.1X - we need -Dwired in this case.
> > I wasn't even aware that possibility existed. :) Do you think it makes
> > sense to provide a unit file for each of the driver options? I'm rather
> > thinking that providing a template that works for the most common setups
> > may be sufficient.
No, it is sufficient to provide unit files for non-deprecated setups
only. That is, for -Dwired and -Dnl80211. And you have already provided
one more unit file for a NetworkManager-based setups.
> > >
> > > Also, there is a use case for two wpa_supplicants on two interfaces, with
> > > different configs: one for normal wireless, one for wired 802.1X, with
> > > different interface metrics. Your service file doesn't support this.
> > I suppose one could name the configuration file
> > /etc/wpa_supplicant/wpa_supplicant-%I.conf
Yes, this would work.
> > > And finally, how do you guarantee the correct ordering - i.e. that
> > > wpa_supplicant should not start before the interface appears?
> > Ah, right. Is "After=sys-devices-*-net-%I.device" possible and
> > sufficient? systemd.unit(5) doesn't say anything about globbing.
I suppose there is no need to apply globs, because of the following udev
rule that exists in 99-systemd.rules:
SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd",
but I have not done any testing. It would be interesting to see, though,
what happens if one unplugs and replugs a USB-based wireless dongle
(sorry, I don't have one here).
> Except that for automatically configured interfaces with eg
> NetworkManager and other network control services, we don't really want
> *any* configuration file given, because the control service handles all
> of that itself; in that case all we want is passing "-u" to enable the
> D-Bus interface. So it's pretty hard to build a one-size-fits-all
> wpa_supplicant service/unit file.
There is already a separate unit file for that use case. As I already
said, NM + wired 802.1X + wireless exhaust all use cases that I
encountered in the wild with free drivers.
Alexander E. Patrakov
More information about the systemd-devel