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/kresd: fix systemd dependency cycle #33614

Merged
merged 1 commit into from Jan 9, 2018

Conversation

erosennin
Copy link
Contributor

Motivation for this change

kresd.service makes sockets.target depend on itself causing a dependency cycle:

$ systemd-analyze verify default.target
sockets.target: Found ordering cycle on sockets.target/start
sockets.target: Found dependency on kresd.service/start
sockets.target: Found dependency on kresd-cachedir.service/start
sockets.target: Found dependency on basic.target/start
sockets.target: Found dependency on sockets.target/start
sockets.target: Breaking ordering cycle by deleting job kresd.service/start
kresd.service: Job kresd.service/start deleted to break ordering cycle starting with sockets.target/start

As a result, kresd.service won't start on system boot. This PR fixes that.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

The unnecessary dependency of sockets.target on kresd.service causes a
dependency cycle preventing kresd.service from starting at boot:

sockets.target -> kresd.service -> basic.target -> sockets.target
@vcunat
Copy link
Member

vcunat commented Jan 8, 2018

❤️
The service is the same as 17.09, and I think the problem doesn't happen. I'll try to look deeper tomorrow.

@vcunat
Copy link
Member

vcunat commented Jan 9, 2018

Hmm, I get the warning but the service always starts anyway.

@vcunat vcunat merged commit f19d959 into NixOS:master Jan 9, 2018
vcunat added a commit that referenced this pull request Jan 9, 2018
The PR was extended with other fixes.  All tested by me atop 17.09.
@vcunat
Copy link
Member

vcunat commented Jan 9, 2018

🆗 Added a few other improvements. Please, @mention me for anything related to knot-resolver. Feedback is welcome.

@erosennin
Copy link
Contributor Author

Thanks for the fast response!

@erosennin erosennin deleted the kresd-ordering-cycle branch January 24, 2018 12:29
@jbboehr
Copy link
Contributor

jbboehr commented Jan 30, 2018

Is this going to be backported to 17.09?

vcunat pushed a commit that referenced this pull request Jan 31, 2018
The unnecessary dependency of sockets.target on kresd.service causes a
dependency cycle preventing kresd.service from starting at boot:

sockets.target -> kresd.service -> basic.target -> sockets.target

(cherry picked from commit f19d959)
@vcunat
Copy link
Member

vcunat commented Jan 31, 2018

Right, done.

@jbboehr
Copy link
Contributor

jbboehr commented Jan 31, 2018

Thanks!

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.

None yet

4 participants