I first noticed this with /etc/fscrypt.conf. It looks like fscrypt tries to update this file by creating a temporary file, removing the old file, and then replacing it with the new one, but this causes issues when /etc/fscrypt.conf is a bind mount (since removing the path fails¹), or a symlink (since replacing the symlink means the new file is no longer written to the intended location).
A similar issue exists with /.fscrypt. Some systems use automated mechanisms to recreate paths that are stored elsewhere² (for example, through the aforementioned bind mounts or similar approaches). These mechanisms may create the directory before fscrypt has initialized it, resulting in an empty /.fscrypt. fscrypt then fails to write to it's directory³ even though no fscrypt metadata is present.
If I understood correctly, this issue seems related to #327
¹ - with output [ERROR] fscrypt setup: remove /etc/fscrypt.conf: device or resource busy.
² - such as NixOS with impermanence/preservation setups.
³ - with output similar to [ERROR] fscrypt setup: rename /.tmp2978932384/.fscrypt /.fscrypt: file exists.
I first noticed this with
/etc/fscrypt.conf. It looks like fscrypt tries to update this file by creating a temporary file, removing the old file, and then replacing it with the new one, but this causes issues when/etc/fscrypt.confis a bind mount (since removing the path fails¹), or a symlink (since replacing the symlink means the new file is no longer written to the intended location).A similar issue exists with
/.fscrypt. Some systems use automated mechanisms to recreate paths that are stored elsewhere² (for example, through the aforementioned bind mounts or similar approaches). These mechanisms may create the directory before fscrypt has initialized it, resulting in an empty/.fscrypt. fscrypt then fails to write to it's directory³ even though no fscrypt metadata is present.If I understood correctly, this issue seems related to #327
¹ - with output
[ERROR] fscrypt setup: remove /etc/fscrypt.conf: device or resource busy.² - such as NixOS with impermanence/preservation setups.
³ - with output similar to
[ERROR] fscrypt setup: rename /.tmp2978932384/.fscrypt /.fscrypt: file exists.