-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hostapd service, degrated systemd dependencies #16090
Comments
the cfg is an alias, |
Looking at your log there is something wrong with the service in my opinion. It seems as if |
the line below won't work:
i even tried:
what you proposedusing this config:
it fails with;
what i proposed
results in
works pretty well. combinationthis seems to work also:
so what should we do? |
My guess is that the problem is not directly related to |
br0 setup
|
@groxxda ideas? |
@qknight
and optionally
|
configuration.nix
systemctl status br0-netdev.service
journalctl -u br0-netdev.service
systemctl cat br0-netdev.service
systemctl list-dependencies --after br0-netdev.service (my fixed hostapd.service)
systemctl list-dependencies network.target
|
Well thanks for the outputs, but they are not really helpful to me because they don't show the error 😞
Maybe this is enough to get everything working. |
I have exactly same problem. A race condition between systemd bridge and hostapd bridge. Have you managed to solve the issue? |
@luminoso |
now the output but without the following two lines:
configuration.nix
systemctl status br0-netdev.service
journalctl -u br0-netdev.service
systemctl cat br0-netdev.service
systemctl list-dependencies --after br0-netdev.service (my fixed hostapd.service)
systemctl list-dependencies network.target
|
if i just add the code below it'll work:
i think the device needs to be up in ordert to add it to a bridge. |
@luminoso could you please check if that also fixes your issue? |
@qknight I'm sorry for the delay replying. |
since nobody has a better idea, i close this as the fix: |
Ah, I've been meaning to comment on this for a while but not gotten around to it. I've been having trouble with a race condition related to this. I think hostapd was (sometimes) trying to come up before my wifi device was available at boot. A My data is limited to just me, but I applied this fix and haven't seen the problem since. Shouldn't this change be more directly integrated into the hostapd package? It really looks like, logically, it should have been there all along. Or is there other logic which is supposed to regulate the ordering, that is just buggy for me? |
@mrobbetts yes, i could fix this in nixpkgs but so far it seemd that i'm the only one affected. the question is, should i? |
I hope so! From my point of view, it looks as though this is a real bug in the module. IMO, bugs ought to be fixed if they are low risk, even if nobody you know of is suffering from them, because they may suffer later and in unpredictable ways. Others may not agree with that, I know. While I know the hostapd module is not fully developed (currently, the overwhelming majority of my hostapd configuration is poured into Of course, I'm assuming this is the real bug. I'm not familiar enough with systemd to know if there is another/better way of handling this, or if it should actually be working but there's a bug elsewhere. If this all sounds logical to you, I'd definitely advocate towards fixing it. |
fixed in #26573 |
This issue is not fixed, and the race is still present in the master branch. I have submitted a PR though, and I would welcome testing. The root cause of this is that if hostapd.service loses the race against br0-netdev.service the latter will call The fix is moving hostapd between br0-netdev.service by hanging it below network-link-wlp4s0.service which br0-netdev.service depends on. This is mostly achieved by cleaning up the "after" clause and introducing a requiredBy clause. See PR for a PDF of the cleaned-up systemd dependency tree. |
i've tried to reproduce my original problem using (18.03) 45f52f7 but it doesn't hit the race at all. that said, i tested:
i'll do some more investitation but don't understand why it works now. update:
missed the warning in the output and virtually updated the system without any patch of mine... who creates these defaults? why not 'abort' instead of warning? |
see #45464 (comment) |
Issue description
nixos-version: 16.03.714.69420c5 (Emu)
in
nixos/modules/services/networking/hostapd.nix
we have this code:when using this with the configuration below:
we will see this in the boot log:
boot log
fix
@Clever suggested to use:
systemd.services.hostapd.after = [ "sys-subsystem-net-devices-wlp4s0.device" "nat.service" "bind.service" "dhcpd.service" ];
in the configuration.nixthis makes it work! we have to replace:
"${cfg.interface}-cfg.service"
by
sys-subsystem-net-devices-${cfg.interface}.device
note: there is no
${cfg.interface}-cfg.service
on my system by looking atsystemctl
's output. instead i seesys-subsystem-net-devices-${cfg.interface}.device
which should be the dependency we want instead. guess: this was probably renamed at some point or something.shall i crate a PR for this fix?
@edolstra
The text was updated successfully, but these errors were encountered: