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

Merge pull request #78426 from Mic92/tmpfiles #78426

Merged
merged 1 commit into from Jan 27, 2020
Merged

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Jan 24, 2020

Especially tmp.conf is important to create /tmp and /var/tmp with the correct
permissions.

Motivation for this change
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.

Especially tmp.conf is important to create /tmp and /var/tmp with the correct
permissions.
@Mic92 Mic92 requested a review from flokli January 24, 2020 17:21
@@ -869,11 +869,15 @@ in
"sysctl.d/50-coredump.conf".source = "${systemd}/example/sysctl.d/50-coredump.conf";
"sysctl.d/50-default.conf".source = "${systemd}/example/sysctl.d/50-default.conf";

"tmpfiles.d/home.conf".source = "${systemd}/example/tmpfiles.d/home.conf";
Copy link
Member Author

@Mic92 Mic92 Jan 24, 2020

Choose a reason for hiding this comment

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

"tmpfiles.d/journal-nocow.conf".source = "${systemd}/example/tmpfiles.d/journal-nocow.conf";
"tmpfiles.d/portables.conf".source = "${systemd}/example/tmpfiles.d/portables.conf";
Copy link
Member Author

@Mic92 Mic92 Jan 24, 2020

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

This link 404s

Copy link
Member

Choose a reason for hiding this comment

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

This file is only present in more recent versions: https://github.com/NixOS/systemd/blob/nixos.v243.4/tmpfiles.d/portables.conf

Copy link
Member

Choose a reason for hiding this comment

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

Note that portabled doesn't even work on nixos currently. It crashes somewhere deep in systemd .

@grahamc
Copy link
Member

grahamc commented Jan 24, 2020

Would it be worth having some sort of test which asserts that all of the tmpfiles provided by systemd are either installed or explicitly rejected?

"tmpfiles.d/static-nodes-permissions.conf".source = "${systemd}/example/tmpfiles.d/static-nodes-permissions.conf";
"tmpfiles.d/systemd.conf".source = "${systemd}/example/tmpfiles.d/systemd.conf";
"tmpfiles.d/systemd-nologin.conf".source = "${systemd}/example/tmpfiles.d/systemd-nologin.conf";
Copy link
Member Author

@Mic92 Mic92 Jan 24, 2020

Choose a reason for hiding this comment

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

"tmpfiles.d/systemd-nspawn.conf".source = "${systemd}/example/tmpfiles.d/systemd-nspawn.conf";
"tmpfiles.d/systemd-tmp.conf".source = "${systemd}/example/tmpfiles.d/systemd-tmp.conf";
"tmpfiles.d/tmp.conf".source = "${systemd}/example/tmpfiles.d/tmp.conf";
Copy link
Member Author

@Mic92 Mic92 Jan 24, 2020

Choose a reason for hiding this comment

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

@Mic92
Copy link
Member Author

Mic92 commented Jan 24, 2020

Would it be worth having some sort of test which asserts that all of the tmpfiles provided by systemd are either installed or explicitly rejected?

Yes, but I am not quite sure how to implement that in a smart way.

@flokli
Copy link
Contributor

flokli commented Jan 24, 2020

Would it be worth having some sort of test which asserts that all of the tmpfiles provided by systemd are either installed or explicitly rejected?

Yes, but I am not quite sure how to implement that in a smart way.

Can't we do something similar as done with systemd.packages?

@Mic92
Copy link
Member Author

Mic92 commented Jan 24, 2020

Would it be worth having some sort of test which asserts that all of the tmpfiles provided by systemd are either installed or explicitly rejected?

Yes, but I am not quite sure how to implement that in a smart way.

Can't we do something similar as done with systemd.packages?

Right, this uses runCommand. I would leave this out of the scope of this pr, since we could backport this fix.

@flokli
Copy link
Contributor

flokli commented Jan 24, 2020

Fine for me to go with this route for now, but we should really move this to something automatic in the NixOS module to prevent future breakages.

@Mic92
Copy link
Member Author

Mic92 commented Jan 25, 2020

@GrahamcOfBorg test systemd systemd-nspawn

@Mic92 Mic92 changed the title nixos/systemd: add all systemd tmpfiles files Merge pull request #78426 from Mic92/tmpfiles Jan 27, 2020
@Mic92 Mic92 merged commit 43f1175 into NixOS:master Jan 27, 2020
@Mic92 Mic92 deleted the tmpfiles branch January 27, 2020 09:55
@schmittlauch
Copy link
Member

Fine for me to go with this route for now, but we should really move this to something automatic in the NixOS module to prevent future breakages.

Feature freeze for 20.03 was just announced. So if we'd like to get the automated approach into 20.03, that has to happen quickly.

@Mic92
Copy link
Member Author

Mic92 commented Jan 30, 2020

This is more relevant if we perform systemd updates in future for 20.03 it should be fine.

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

5 participants