nixos/tinydns: port test to python#73059
Conversation
In cases where you boot up really quickly (like in the VM test on a non-busy host), tinydns might want to bind before the loopback interface is fully up. Order tinydns after network.target to fix that.
c57dd5e to
caac096
Compare
|
There was some flakyness in the tests, as sometimes |
|
@GrahamcOfBorg test tinydns |
| systemd.services.tinydns = { | ||
| description = "djbdns tinydns server"; | ||
| wantedBy = [ "multi-user.target" ]; | ||
| after = [ "network.target" ]; |
There was a problem hiding this comment.
You should never use network.target: it's meant to be pulled in by services providing the network link/setup, like dhcpcd. Use network-online.target instead. See #50930 (comment)
There was a problem hiding this comment.
Does tinydns fail horribly during startup if there's no default route? Otherwise, systemd docs explicitly mention we should go after network.target, not network-online.target:
Units that strictly require a configured network connection should pull in network-online.target (via a Wants= type dependency) and order themselves after it. This target unit is intended to pull in a service that delays further execution until the network is sufficiently set up. What precisely this requires is left to the implementation of the network managing service.
There was a problem hiding this comment.
Does tinydns fail horribly during startup if there's no default route?
Probably not but it's logically not part of setting up the network link and needs an internet connection.
There was a problem hiding this comment.
We don't set wants, or make it partOf network.target - we only set an after.
Setting After=network-online.target would mean we wait with starting tinydns until there's a default route. This means if you're enabling tinydns on your laptop, you don't reach multi-user.target until you get an internet connection.
I don't think that's necessary, but tinydns needs to wait until there's a network interface available in the system, so setting After=network.target should be right. 😕
There was a problem hiding this comment.
Oh, you are right: I was confusing After with Wants, sorry.
Motivation for this change
#72828
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"./result/bin/)nix path-info -Sbefore and after)Notify maintainers
cc @worldofpeace @tfc