I would like a file based filesystem (~/Archives/inventory.locker) mounted upon user login and unmounted upon logout (~/Documents/Inventory).
pam_mount
seems to provide the functionality I am after, but it has incompatibilites with pam_systemd
.
I have tried writing a user based systemd.mount
unit, but it fails with:
mount: only root can do that
Even though I have the 'user' mount option defined and can successfully mount as user manually.
The systemd
method seems ideal because it requires no other dependencies and is also per user process and not per login session.
I am open to alternative solutions too.
automount
? It will mount the filesystem only when it's path is accessed. If the mountpoint is within the users home directory it should only be accessible by that user, so only when they're logged in can it be mounted. – Centimane Oct 17 '16 at 16:56