<div style="font-family: Arial, sans-serif; font-size: 14px;">Hello,</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I've stumbled on some odd, seemingly inconsistent behavior when the systemd properties ProtectSystem=strict, ProtectHome=read-only, and ReadWritePaths are used in combination.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Consider the following command:</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><span style="font-family: Menlo, Consolas, "Courier New", monospace;">run0 --property=ProtectSystem=strict --property=ProtectHome=read-only --property=ReadWritePaths="$DIRECTORY" bash -c "findmnt -nru -o OPTIONS --target=$DIRECTORY"</span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">If $DIRECTORY is a non-root user's home directory, the above command shows that the directory is mounted read-write in the transient service unit ("rw" is among the options printed by findmnt). However, if $DIRECTORY is /root (the root user's home directory), /root gets mounted read-only, as if the ReadWritePaths directive was ignored.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I've confirmed this behavior in up-to-date Arch and Kubuntu 25.04 VMs. Strangely, on a Fedora atomic desktop, this behavior does <i>not</i> occur with /var/roothome, the root user's home directory. All three systems are running systemd 257.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Does anyone know what's going on here? Is this a bug or just some complex interaction of these properties that I'm not understanding properly?</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Thanks,</div><div style="font-family: Arial, sans-serif; font-size: 14px;">Daniel Hast</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;" class="protonmail_signature_block protonmail_signature_block-empty">
<div class="protonmail_signature_block-user protonmail_signature_block-empty">
</div>
<div class="protonmail_signature_block-proton protonmail_signature_block-empty">
</div>
</div>