pam_mount/pam_mount-0.18-umount-home-dir.dif

19 lines
512 B
Plaintext
Raw Normal View History

--- scripts/umount.crypt
+++ scripts/umount.crypt 2007/01/12 08:59:14
@@ -57,6 +57,15 @@
exit 1;
fi;
+# kill remaining user processes if we're unmounting a user's home dir
+getent passwd | grep -e ":$1:" &> /dev/null
+if test $? -eq 0; then
+ lsof -t $1 | xargs kill -TERM &> /dev/null
+ sleep 1
+ lsof -t $1 | xargs kill -9 &> /dev/null
+ sleep 1
+fi
+
# ask cryptsetup about the underlying device
#
REALDEVICE=` "$CRYPTSETUP" status "$DMDEVICE" | sed -n '/device/s/[ ]*device:[ ]*//p'`;