nixos/unifi: create data directory with correct permissions #66073
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
#66005
Things done
The cause of issue above seems to be the change introduced in #56265. Before that, the permissions of the
data
directory were fixed in the preStart script withchown
andpermissionsStartOnly
set.The data directory is bind-mounted via
systemd.mounts
, created if not already present and therefore had the wrong permissions which was fixed before withchown
.Now that tmpfiles.d is used with the
e
type, the permissions would only be correctly set if the directory already existed (seetmpfiles.d(5)
).I suspect that tmpfiles.d runs before the bind mounts and does therefore not set the correct permissions.
I tried using the
uid
option for the bind mount of the data directory but somehow I didn't get it to work.sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)(1): test I used for local testing
cc @aanderse