pam_mount (and more specifically /sbin/umount.crypt) fails to umount home directories if user processes are still running. This patch will stop these processes before unmounting the block device. This patch is already in use by SuSE (see pam_mount-0.18-umount-home-dir.diff). Two more things to fix (IMHO): 1: in /etc/security/pam_mount.conf the proper path for lsof is /usr/sbin/lsof (not /usr/bin/lsof). 2: emerging pam_mount will create /usr/sbin/umount.crypt which is a useless (AFAIK) duplicate of /sbin/umount.crypt.
Created attachment 123072 [details, diff] pam_mount-0.18-umount-home-dir.diff
Next time please one issue per bug. patch has been rejected upstream. If you rely on this feature, I'd suggest to create a patch that accepts it as an option. 1. I'll fill a bug against lsof 2. done
lsof is fixed, for your patch please handle that with upstream.