Problem: Renaming the USB network interface makes SYSTEMD_WANTS not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Adding NAME="mywifi" to an udev rule causes the SYSTEMD_WANTS service to not be executed. Removing NAME="mywifi" and the service is executed. How come?

/etc/udev/rules.d/10-network.rules
  SUBSYSTEM=="net", ACTION="" ATTR{address}=="...", TAG+="systemd", ENV{SYSTEMD_WANTS}="test.service"

/etc/systemd/system/test.service
  [Service]
  Type=simple
  ExecStart=/bin/echo %n started!

First try, it works:
I type:
# journalctl -f -u test.service
I plug the USB Wi-Fi device and it prints:
"test.service started!"
Note that ip link show returns wlan1.

Now I add NAME="mywifi" which gives:
/etc/udev/rules.d/10-network.rules
  SUBSYSTEM=="net", ACTION="" ATTR{address}=="...", NAME="mywifi", TAG+="systemd", ENV{SYSTEMD_WANTS}="test.service"
I plug the USB Wi-Fi device and it prints nothing.
Note that ip link show returns mywifi.
I remove NAME="mywifi" and it prints "test.service started!" again.

I really do not understand. When using RUN, it works all the time. SYSTEMD_WANTS seems to work only when the interface is not renamed. I tried also to rename it with a .link file, it got renamed but the service is still not triggered.

Hope you can help me out.
Thanks in advance for your time,
Charles


Sent with Proton Mail secure email.

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux