Repository navigation
nixos/stage-2: add x-initrd.mount to nixStoreMountOpts - #560805
Conversation
Adding the x-initrd.mount flag here ensures that systemd keeps this mount around until the very end of the shutdown procedure and thus avoids the error message that it was unable to unmount the Nix Store. This was first reported here: NixOS/nixos#126 We always carried a patch to systemd to avoid this message.# The patch 0001-Don-t-try-to-unmount-nix-or-nix-store.patch becomes unnecessary with this commit and can be removed.
|
Hold on, does this actually work? I understand |
The only reason we still got this warning from systemd about being unable to properly unmount the disk is because we remount /nix/store without x-initrd.mount in the activation script/nixos-init. The underlying disk is always "protected" with x-initrd.mount because our fileSystems attr always adds it for /nix/store and /. |
74068d0
Unfortunately I don't think this is true, @nikstur. The I tried to argue upstream that anything mounted in initrd should only be unmounted in exitrd by default, but this notion was rejected: systemd/systemd#38767 |
- Removed 0001-Don-t-try-to-unmount-nix-or-nix-store.patch because we fixed it in NixOS with NixOS#560805 - Removed 0003-add-rootprefix-to-lookup-dir-paths.patch because we fixed it in NixOS with NixOS#559314 - Removed 0006-timesyncd-disable-NSCD-when-DNSSEC-validation-is-dis.patch because it was fixed upstream by systemd/systemd#43380
I look at it this way:
When I removed the patch and set x-initrd.mount, all our systemd tests pass (including the shutdown test). So I don't see a reason to keep the patch around even if it might in theory be more "correct". |
|
uh, because it will literally completely break shutdown scripts? The umount loop happens before shutdown scripts are run. Removing this patch is going to break a supported systemd feature. I agree with the aversion to patches in general, but I'm sorry, this is too far. "I only care that the error message in our tests goes away, not if it's correct" is a completely ridiculous extent to take this to, @nikstur. |
Our shutdown test in nixosTests.systemd keeps working so I cannot verify this claim. Please check the test and confirm that it indeed tests the shutdown and if not we need to change the test to actually test this feature.
This is not what I said. I said I care about observable behavior and I cannot observe shutdown scripts not working. |
|
My apologies for the harshness. I'll add a test. |
- Removed 0001-Don-t-try-to-unmount-nix-or-nix-store.patch because we fixed it in NixOS with NixOS#560805 - Removed 0003-add-rootprefix-to-lookup-dir-paths.patch because we fixed it in NixOS with NixOS#559314 - Removed 0006-timesyncd-disable-NSCD-when-DNSSEC-validation-is-dis.patch because it was fixed upstream by systemd/systemd#43380
Adding the x-initrd.mount flag here ensures that systemd keeps this
mount around until the very end of the shutdown procedure and thus
avoids the error message that it was unable to unmount the Nix Store.
This was first reported here: NixOS/nixos#126
We always carried a patch to systemd to avoid this message.
The patch 0001-Don-t-try-to-unmount-nix-or-nix-store.patch becomes
unnecessary with this commit and can be removed.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.