[systemd-devel] WiFi device starting a service
Paul D. DeRocco
pderocco at ix.netcom.com
Sat Sep 28 00:22:34 PDT 2013
I'm working with a Gumstix, and I want to run an "ifup" command when the
WiFi device becomes available. I'm not sure why, but it always seems to
become available after the boot process is complete, so I can't use a
regular service unit tied to something like multi-user.target. So I'm
trying to have a udev rule launch a service instead. My first guess is
this:
/etc/udev/rules.d/wlan0-ifup.rules:
SUBSYSTEM=="net", KERNEL=="wlan0", \
ENV{SYSTEMD_WANTS}+="wlan0-ifup.service"
/etc/systemd/system/wlan0-ifup.service:
[Unit]
Description=Bring wlan0 up
DefaultDependencies=false
[Service]
ExecStart=/sbin/ifup wlan0
Naturally, the service never runs, so it doesn't work. After logging in, I
can manually start the service, and the WiFi connects, so the problem has
to be in my udev rule. I ask here, because this seems more
systemd-specific than udev-specific.
There's also a rule in 99-systemd.rules:
SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", \
ENV{SYSTEMD_ALIAS}+="/sys/subsystem/net/devices/$name"
I suspect that there's a way to hook something to that, but I can't figure
out how.
So what's the right way to do this? Is there a man page specifically for
this situation?
--
Ciao, Paul D. DeRocco
Paul mailto:pderocco at ix.netcom.com
More information about the systemd-devel
mailing list