I've been tinkering with the automatic unlock of encrypted zfs datasets on login (at the console) which works great but when the user logs out they get the following errors:

login[65695]: zfs_unmount failed for zroot/home/$homedir with: -1
login[65695]: unmount_dataset failed with: -1

2 questions:
- Where do I configure the unmounting of datasets on logout?
- Where do I look to figure out why its not unmounting? The user has the mount zfs permission (and they can mount fine)

What am I getting wrong?

#FreeBSD #OpenZFS

@oxyhyxo try using umount -f and do a pslist-ilU $USER prior to see what’s still running?

@dch til about the existence of pslist 🧐

I havent implemented any scripts to fire on logout and yet **something** is calling unmount. All I did was update pam to add pam_zfs_key.

@oxyhyxo oh is it a thing already built into pam?
@dch I guess? I’ll continue digging
@oxyhyxo @dch I'd be interested to know if you get it working. I have a similar setup on my laptop.
pam_zfs_key failures lead to password prompts for root su · Issue #11222 · openzfs/zfs

System information Type Version/Name Distribution Name Debian Distribution Version unstable Linux Kernel 5.9 Architecture amd64 ZFS Version 2.0-release (813185d) Describe the problem you're observi...

GitHub