nixos/dhcpcd: fix race between namespace setup and resolvconf#348305
nixos/dhcpcd: fix race between namespace setup and resolvconf#348305rnhmjoj merged 1 commit intoNixOS:masterfrom
Conversation
I think the bug here is that
Ordering only works on |
that's not just a systemd thing, that's a linux namespace thing. i believe that even with this fix, if another service were to edit the /etc directory is secured by user permissions, so it should be safe to just bind |
6d2e719 to
88d0049
Compare
Yes, it seems the correct solution. Thank you.
Yes, but probably then /run/resolvconf would be the next to trigger the error, and I don't think giving access to all of /run is ideal. |
There was a problem hiding this comment.
These shouldn't need to be optional since resolvconf.service just won't exist if disabled.
systemd requires paths in `ReadWritePaths=` to exist before setting up the service sandbox, so dhcpcd should be ordered after resolvconf. Making resolvconf a oneshot service ensure `After=resolvconf.service` works correctly.
|
For me the test is still hanging, I'm afraid. I tried a couple times on two different x86_64 machines. |
88d0049 to
52e2e70
Compare
|
@ofborg test networking.networkd.dhcpSimple |
|
It should be |
|
Well, the scripted ones do pass on Hydra. It's the networkd ones that block the channel. See e.g. |
|
Ah, so it has nothing to do with dhcpcd! It's the test |
This reverts commit bad5251. #348305 (comment) Should've known that commit starting with `bad` will be no good. Fixes nixosTests.networking.networkd.dhcpSimple https://hydra.nixos.org/build/274843085/nixlog/8/tail
|
All other channel-critical tests succeeded on the previous eval, so I hope we'll good now 🤞🏽 |
|
(Note: the race condition is still a thing, but it's not blocking the channel) |
|
Ok, it seems |
This reverts commit bad5251. NixOS#348305 (comment) Should've known that commit starting with `bad` will be no good. Fixes nixosTests.networking.networkd.dhcpSimple https://hydra.nixos.org/build/274843085/nixlog/8/tail
systemd requires paths in
ReadWritePaths=to exist before setting up the service sandboxand there is apparently no way to control this with the usualAfter=,Wants=etc.Instead, we have to mark all the paths as optional, even if they're not, then manually check if they exist, fail if they don't and wait for the service to be restarted.
so dhcpcd should be ordered after resolvconf. Making resolvconf a oneshot service ensure
After=resolvconf.serviceworks correctly.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truedhcpcd.testsand--rebuilda few timesnix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.