Hi everyone,
I’m trying to figure out how the directory permissions are supposed to work with impermanence.
For example, I have configured Prometheus service, which has dataDir
set to /var/lib/prometheus2
and to persist it I use this config (notice the user
and group
are set to root
):
environment.persistence = {
"/persist".directories = [{
directory = "/var/lib/prometheus2";
user = "root";
group = "root";
mode = "0700";
}];
};
At this point there is neither /var/lib/prometheus2
nor /persist/var/lib/prometheus2
directories. When I do nixos-rebuild switch
:
- in the output I see:
this looks good;Warning: Source directory '/persist/var/lib/prometheus2' does not exist; it will be created for you with the following permissions: owner: 'root:root', mode: '0700'.
- however, when I check what is in the
/persist/var/lib
, I get:
The owner and group aredrwx------ 1 prometheus prometheus 8 Sep 8 13:09 prometheus2
prometheus
and notroot
. - the same applies to
/var/lib
:
The owner and group aredrwx------ 1 prometheus prometheus 8 Sep 8 13:09 prometheus2
prometheus
and notroot
. - when I
umount /var/lib/prometheus2
and check the/var/lib
:
The owner and group aredrwx------ 1 root root 0 Sep 8 13:09 prometheus2
root
.
Is this expected behaviour?