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

Some systemd fixes revolving dbus and socket activation of systemd services #88158

Merged
merged 3 commits into from Jun 13, 2020

Conversation

arianvp
Copy link
Member

@arianvp arianvp commented May 19, 2020

Motivation for this change

Resolved wasnt being activated by dbus; which caused DNS errors to occur shortly after or during nixos-rebuild switch'ing . I took the time to fix the activation for all upstream systemd services.

Also fixed socket activation for systemd-networkd. so that it can be activated by netlink messages.

Second try of #87263

Fixes #85855

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@arianvp
Copy link
Member Author

arianvp commented May 19, 2020

@GrahamcOfBorg test systemd-timesyncd systemd-networkd systemd-networkd-vrf networking.networkd systemd

@arianvp
Copy link
Member Author

arianvp commented May 19, 2020

I'm not sure why the networkd-vrf test failed on aarch64. seems flakey to me. let me try again:

@GrahamcOfBorg test systemd-timesyncd systemd-networkd systemd-networkd-vrf networking.networkd systemd

Copy link
Contributor

@flokli flokli left a comment

Choose a reason for hiding this comment

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

LGTM otherwise (but haven't tested myself so far)

nixos/modules/system/boot/networkd.nix Outdated Show resolved Hide resolved
nixos/modules/system/boot/networkd.nix Outdated Show resolved Hide resolved
@flokli
Copy link
Contributor

flokli commented May 28, 2020

Closing in favour of #89064.

@flokli flokli closed this May 28, 2020
@flokli flokli reopened this Jun 1, 2020
@flokli
Copy link
Contributor

flokli commented Jun 1, 2020

Reopened as per #89064 (comment).

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

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

Looks good to me - it appears to fix the network loss on nixos-rebuild.

I'll let someone else with a little more knowledge on systemd merge though.

Probably should be backported to nixos-20.03.

@flokli
Copy link
Contributor

flokli commented Jun 11, 2020

@arianvp can you address the changes requested in this PR?

As #89064 (comment) hasn't received any feedback, I propose merging this one first, and then doing #89064 later.

@flokli
Copy link
Contributor

flokli commented Jun 11, 2020

@matthewbauer This has been broken for quite some time, it's not a regression with 20.03.

If we still merge this to 20.03, IMHO it should get at least a month of testing in nixos-unstable before thinking about backporting.

@matthewbauer
Copy link
Member

@matthewbauer This has been broken for quite some time, it's not a regression with 20.03.

If we still merge this to 20.03, IMHO it should get at least a month of testing in nixos-unstable before thinking about backporting.

Hmmm... yeah it definitely was a regression that I started noticing since 19.03 or 19.09. It doesn't always happen, so maybe I shouldn't be so sure this actually fixed it. It seems like a rebuild that touches network configuration options make it more likely.

This will make dbus socket activation for it work

When `systemd-resolved` is restarted; this would lead to unavailability
of DNS lookups.  You're supposed to use DBUS socket activation to buffer
resolved requests; such that restarts happen without downtime
With this systemd buffers netlink messages in early boot from the kernel
itself; and passes them on to networkd for processing once it's started.
Makes sure no routing messages are missed.

Also makes an alias so that dbus can activate this unit. Upstream has
this too.
Upstream has this alias too; so that dbus activation works.
What I don't fully understand is why this would ever be useful given
this unit is already started way in early boot; even before dbus is up.
But lets just keep behaviour similar to upstream and then ask these
questions to upstream.
@flokli
Copy link
Contributor

flokli commented Jun 13, 2020

I addressed the required changes and will merge this in now.

@flokli flokli merged commit b46fba4 into NixOS:master Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

systemd: ship dbus system services
3 participants