-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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/switch-to-configuration: remove explicit tmpfiles invocation #269983
Conversation
@ofborg test switchTest |
This seems like a change in semantics, which should maybe be documented. Previously every switch executed this, whereas now, it requires a changed to tmpfiles.d. |
This shouldn't be an issue. If the config (i.e. tmpfiles.d) hasn't changed I don't see what tmpfiles should've done previously. |
I should have looked at this earlier. This is potentially problematic. Any services with |
Granted, units with those properties are probably in the "very strange" category. Edit: Yea, to prove it, here's this on my desktop:
So my concern is probably nothing to worry about |
This broke |
Going to revert this for now. |
The issue seems to be that services expect to be started after Fixing this ordering seems very non-trivial. As a completely separate concern, the test had these log lines, which are concerning because they make no sense to me.
These are things that |
This is the reason we need this though. More concretely, for the perlless activation, tmpfiles needs to run after sysusers (which it naturally is ordered after) to create files with the correct owners. |
@nikstur To be clear, that comment has nothing to do with why this was reverted. Totally separate concern. Anyway, I think you have that backwards? That comment was about services ordered |
@ElvishJerricco you're right I got that backwards. This comment in stc seems to describe what is happening here: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/activation/switch-to-configuration.pl#L611 However, adding X-StopOnReconfiguration to sysinit.target doesn't seem to work. The test then hangs when stopping sysinit.target. I think the easiest solution, unless maybe @dasJ shows us the way towards stc enlightenment, is to just execute systemd-sysusers in an (re-)activationScript, however cursed that may be. |
@nikstur Yea, you cannot stop
Stopping sysinit will stop literally all services that don't have Conceptually, I wonder if the right approach would be a new target, say |
|
Description of changes
Remove explicit invocation of tmpfiles. Instead add a restartTrigger to the tmpfiles service unit. This makes ordering implicit and removes bespoke logic from switch-to-configuration.
This should not be pose a big issue because tmpfiles is ordered before sysinit.target, way before normal services are started.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Priorities
Add a 👍 reaction to pull requests you find important.