-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Make /var/empty immutable (with chattr +i) #18365
Conversation
@domenkozar, thanks for your PR! By analyzing the annotation information on this pull request, we identified @edolstra, @nathan7 and @peti to be potential reviewers |
No, don't make it a link to the Nix store! Paths in the Nix store can have group = Also, |
c55bef3
to
7053788
Compare
@edolstra updated |
Just a side note: lots of these |
Could we use a tmpfs with |
7053788
to
4461d3c
Compare
@groxxda what advantage would that have over |
@domenkozar it's probably just me not being a fan of chattr 😉 btw: Does your patch work when run twice? |
4461d3c
to
3877ec5
Compare
@groxxda it did, but I pushed a fix for |
(Updated the title to reflect the solution) |
@edolstra any objections? |
@@ -137,8 +140,13 @@ in | |||
|
|||
mkdir -m 1777 -p /var/tmp | |||
|
|||
# Make sure it's really empty | |||
chattr -i /var/empty | |||
rm -rf /var/empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces a race during activation where /var/empty
doesn't exist. So for example, if it gets interrupted at that point, you won't be able to log in via ssh anymore.
9db5d1d
to
00b9a12
Compare
@edolstra fixed |
00b9a12
to
8f95e6f
Compare
@fpletz I've linked two issues in description of the PR for motivation what issues we fix. I think it's safe to disable this for containers. |
@fpletz here needs to be added Any we probably should test if container deletion works in the tests. |
Ah it already is, but doesn't fail: http://hydra.nixos.org/build/40856595/log/raw |
(cherry picked from commit 14c16f2) Signed-off-by: Domen Kožar <[email protected]>
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/return-container-to-its-original-declared-state/14793/4 |
See #18358 and #14910 what bugs these caused.
cc @edolstra