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

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

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

Looks reasonable. Have not tested either.

@flokli flokli self-requested a review May 9, 2020 15:39
@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
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 via email

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

Successfully merging this pull request may close these issues.

systemd: ship dbus system services
4 participants