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

kresd: runtime fixes #95222

Merged
merged 4 commits into from Aug 16, 2020
Merged

kresd: runtime fixes #95222

merged 4 commits into from Aug 16, 2020

Conversation

eadwu
Copy link
Member

@eadwu eadwu commented Aug 11, 2020

Motivation for this change

Not sure about the directory permissions.

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.

@vcunat
Copy link
Member

vcunat commented Aug 15, 2020

Thanks for ping. I'm not sure I understand – have you ran into some issues? There's tmpfiles spec that should ensure existence of all three. The one for cache was added here as well to

# Ensure correct ownership in case UID or GID changes.

because of ae74a0e. The other two didn't exist before that commit, so they weren't added in the same way.

@vcunat
Copy link
Member

vcunat commented Aug 15, 2020

To be clear, I see no harm in adding this, so I'm mainly curious. (and perhaps the comments are a bit confusing in combination with these "invisible" tmpfiles rules)

@eadwu
Copy link
Member Author

eadwu commented Aug 15, 2020

For some reason the files weren't created on my system. Kept getting CHDIR errors for (/var/lib/knot-resolver) and then errors about /run/knot-resolver not existing for the control.

It actually looks like I'm missing /etc/tmpfiles.d/knot-resolver.conf.

Seems like the problem is that the derivation being used has a symlink to the lib/ directory and it doesn't end up propagating. Using the unwrapped derivation gives me the file in tmpfiles.d.

@vcunat
Copy link
Member

vcunat commented Aug 16, 2020

Oh, and lib/systemd/ does get applied? (from systemd.packages = [ package ];)

EDIT: no, that implementation seems safe. I'm looking into making systemd.tmpfiles.packages resilient to this.

@flokli
Copy link
Contributor

flokli commented Aug 16, 2020

#95565 was merged, which should fix the knot-resolver tmpfiles not being applied.

Even on master, the permissions in the kresd@ template unit differ with what's in the tmpfiles file. tmpfiles will be applied once on boot, and on each system activation, whereas systemd will apply *DirectoryMode when starting the service, too (thus shadowing the tmpfiles).

@vcunat I think we can use only the per-unit directives here. I sent a patch to upstream at knot-resolver@labs.nic.cz - not sure how to exacty send contributions there. Also opened https://gitlab.nic.cz/knot/knot-resolver/-/issues/596.

@vcunat
Copy link
Member

vcunat commented Aug 16, 2020

Yes, I think on NixOS the kresd service can abandon using tmpfiles in favor of these, though I can't really see any practical differences.

@flokli flokli merged commit bda86ee into NixOS:master Aug 16, 2020
wchresta pushed a commit to wchresta/nixpkgs that referenced this pull request Aug 17, 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.

None yet

3 participants