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/resolved: Include dbus alias of resolved unit #87263

Merged
merged 1 commit into from May 9, 2020

Conversation

@arianvp
Copy link
Member

arianvp commented May 8, 2020

This will make dbus socket activation for it work

Fixes #85855

Motivation for this change

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

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.
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
@arianvp
Copy link
Member Author

arianvp commented May 8, 2020

I haven't tested this PR yet.

@Mic92
Mic92 approved these changes May 8, 2020
Copy link
Contributor

Mic92 left a comment

Looks reasonable. Have not tested either.

@flokli flokli self-requested a review May 9, 2020
@flokli flokli added this to To Do in systemd via automation May 9, 2020
@flokli
Copy link
Contributor

flokli commented May 9, 2020

Shouldn't this be conditional on resolved itself being enabled?

@arianvp
Copy link
Member Author

arianvp commented May 9, 2020

It is. This change is in the resolved module

@flokli
Copy link
Contributor

flokli commented May 9, 2020

You're right 🤦‍♂️

@flokli flokli merged commit d4c2f1a into NixOS:master May 9, 2020
13 checks passed
13 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7fe539f"; rev="7fe539f79900efb6b8b6265ade11fdab460ca1da"; } ./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="7fe539f"; rev="7fe539f79900efb6b8b6265ade11fdab460ca1da"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7fe539f"; rev="7fe539f79900efb6b8b6265ade11fdab460ca1da"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7fe539f"; rev="7fe539f79900efb6b8b6265ade11fdab460ca1da"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7fe539f"; rev="7fe539f79900efb6b8b6265ade11fdab460ca1da"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7fe539f"; rev="7fe539f79900efb6b8b6265ade11fdab460ca1da"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="7fe539f"; rev="7fe539f79900efb6b8b6265ade11fdab460ca1da"; } ./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
systemd automation moved this from To Do to Done May 9, 2020
@flokli
Copy link
Contributor

flokli commented May 9, 2020

Thanks!

@eadwu
Copy link
Member

eadwu commented May 9, 2020

This seems to have broke my build? Or it's missing an upstream component?

builder for '/nix/store/qz9dr0aq8sjblfzzq684yhkicsi3ry73-system-units.drv' failed with exit code 1; last 1 log lines:
  missing /nix/store/7s71p4xl1djjg4zi4skzx8nk5j2jw3hv-systemd-245.5/example/systemd/system/dbus-org.freedesktop.resolve1.service
cannot build derivation '/nix/store/6sm6gry8xvwgq2am3nisr040cigy3dgc-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/sbzzxc92m08cw6ca2a3wixfhybgnarbf-nixos-system-terrenus-20.09.20200509.462c7fb.drv': 1 dependencies couldn't be built

I don't seem to have that file in my derivation at all

❯  tree result/ | rg dbus
│   │   │   ├── dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service
│   │   │   ├── dbus-org.freedesktop.import1.service -> systemd-importd.service
│   │   │   ├── dbus-org.freedesktop.locale1.service -> systemd-localed.service
│   │   │   ├── dbus-org.freedesktop.login1.service -> systemd-logind.service
│   │   │   ├── dbus-org.freedesktop.machine1.service -> systemd-machined.service
│   │   │   ├── dbus-org.freedesktop.timedate1.service -> systemd-timedated.service
    ├── dbus-1

Though I have

❯  find result/ -name org.freedesktop.resolve1.service
result/share/dbus-1/system-services/org.freedesktop.resolve1.service
@flokli
Copy link
Contributor

flokli commented May 9, 2020

Yeah, sorry, seems our tooling currently doesn't properly pick it up. Reverted in 8325e0d. @arianvp, can you give this another try?

@arianvp
Copy link
Member Author

arianvp commented May 9, 2020

@arianvp
Copy link
Member Author

arianvp commented May 19, 2020

Found the issue. Unlike most other services in systemd; upstream doesn't include the target.wants symlink by default, and the service needs to be enabled by the administrator by doing systemctl enable.

Given we don't have systemctl enable in NixOS, we should make the alias through the module system.

Other units with this 'problem' are:

$ ag dbus-org
systemd-timesyncd.service.in
54:Alias=dbus-org.freedesktop.timesync1.service

systemd-homed.service.in
40:Alias=dbus-org.freedesktop.home1.service

systemd-networkd.service.in
54:Alias=dbus-org.freedesktop.network1.service

systemd-resolved.service.in
55:Alias=dbus-org.freedesktop.resolve1.service

We should create dbus aliases for them too when they are enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
systemd
  
Done
Linked issues

Successfully merging this pull request may close these issues.

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