... snip ...

> graphically any background tasks and programs that you have running will
> remain running. This is useful for people who use screen etc and keep
> background processes running, however if you want to make sure that when
> someone logs out any of there remaining processes are killed you can set
> KillUserProcesses=yes in /etc/systemd/logind.conf This may be a quick
> and easy way of resolving the issue.


This would not help if the process accessing the disk is not owned by the user - such as service/daemon/userByCron/isForked/etc.


I've set KillUserProcesses=yes in /etc/systemd/logind.conf and rebooted, then
tested again, but with the same result.