Skip to content
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

nixos/networkd: wait for udev to settle before starting networkd #39340

Merged
merged 1 commit into from
Apr 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,9 @@ in
systemd.services.systemd-networkd = {
wantedBy = [ "multi-user.target" ];
restartTriggers = map (f: f.source) (unitFiles);
# prevent race condition with interface renaming (#39069)
requires = [ "systemd-udev-settle.service" ];
after = [ "systemd-udev-settle.service" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I have:

systemd.services.systemd-udev-settle.serviceConfig.ExecStart = ["" "${pkgs.coreutils}/bin/true"];

in my configuration because systemd-udev-settle timeouts on my machine sometimes.
That's why I would be glad if we could get rid of that service sometimes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is not ideal but the best we can do in stage 2 to prevent the race condition. We can revert this as soon as we do the renaming in stage 1.

Copy link
Contributor Author

@xeji xeji Apr 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using systemd-udev-settle, we could add
serviceConfig.ExecStartPre="${systemd.package}/bin/udevadm settle -t 10";
directly to systemd-networkd to use a shorter timeout than the default 120s. I guess 10s will be enough to get interface renaming done... ( on a real system, but on hydra you never know).

};

systemd.services.systemd-networkd-wait-online = {
Expand Down