[arch-general] hostapd and systemd-networkd ordering cycle
Hi, I have a bridge configured through systemd-networkd and a wifi AP with hostpad. The wifi AP interface is attached to the bridge by systemd-networkd. There is a ordering cycle that is: network.target -> systemd-networkd.service -> hostapd.service -> network.target (btw I used https://github.com/jantman/misc-scripts/blob/master/dot_find_cycles.py to helpful debug it.) The unit file of the hostapd has (only pasted relevant info): [Unit] *After=network.target* [Install] WantedBy=multi-user.target That's it. Bu if I create a /etc/systemd/system/hostapd.service.d/after.conf with: [Unit] After= *After=network-pre.target* It never overrides the cycle (it's read but the After is not overridden). If I create a /etc/systemd/system/hostapd.conf with the difference above the it works fine and no ordering cycle. Should I open a PR to fix the /lib/systemd/system/hostapd.service? How? Thanks, Joan.
Hello, After= is one of those parameters that cannot be made empty through "After= ", so your /etc/ file just adds a dependency so it becomes: After=network.target network-pre.target If you want to replace existing dependencies and not just add one, you have to copy the whole unit to /etc/, not just the After= part. So remove your /etc/systemd/system/hostapd.service.d/after.conf, then execute: systemctl edit --full hostapd.service This will create a copy of the hostapd service under /etc/, which will fully override the original one. You can then edit it to your liking. Hope I helped you, Alla On April 19, 2020 10:16:13 AM UTC, "Joan Aymà via arch-general" <arch-general@archlinux.org> wrote:
Hi,
I have a bridge configured through systemd-networkd and a wifi AP with hostpad. The wifi AP interface is attached to the bridge by systemd-networkd.
There is a ordering cycle that is:
network.target -> systemd-networkd.service -> hostapd.service -> network.target
(btw I used https://github.com/jantman/misc-scripts/blob/master/dot_find_cycles.py to helpful debug it.)
The unit file of the hostapd has (only pasted relevant info):
[Unit] *After=network.target* [Install] WantedBy=multi-user.target
That's it. Bu if I create a /etc/systemd/system/hostapd.service.d/after.conf with:
[Unit]
After=
*After=network-pre.target*
It never overrides the cycle (it's read but the After is not overridden). If I create a /etc/systemd/system/hostapd.conf with the difference above the it works fine and no ordering cycle.
Should I open a PR to fix the /lib/systemd/system/hostapd.service? How?
Thanks, Joan.
participants (2)
-
Alla H.
-
Joan Aymà