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 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

@flokli
flokli approved these changes May 22, 2020
Copy link
Contributor

flokli left a comment

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 left a comment

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 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.

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.

arianvp added 3 commits May 8, 2020
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 flokli force-pushed the arianvp:dbus-systemd branch from f697fb5 to 71a6d32 Jun 13, 2020
@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
14 checks passed
14 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="71a6d32"; rev="71a6d32c18edd0312a7436910b00d21d5e6d4c0f"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="71a6d32"; rev="71a6d32c18edd0312a7436910b00d21d5e6d4c0f"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="71a6d32"; rev="71a6d32c18edd0312a7436910b00d21d5e6d4c0f"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="71a6d32"; rev="71a6d32c18edd0312a7436910b00d21d5e6d4c0f"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="71a6d32"; rev="71a6d32c18edd0312a7436910b00d21d5e6d4c0f"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="71a6d32"; rev="71a6d32c18edd0312a7436910b00d21d5e6d4c0f"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="71a6d32"; rev="71a6d32c18edd0312a7436910b00d21d5e6d4c0f"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.