summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-07 12:25:30 +0100
committerSimon Rettberg2016-01-07 12:25:30 +0100
commitb1abeeac19fc125391cf05198b714b01edd388cc (patch)
tree240675cb809fced21ea23f18355b3d4727c72580 /remote/modules
parent[vmware] Don't call exit in a script that's being sourced (diff)
downloadtm-scripts-b1abeeac19fc125391cf05198b714b01edd388cc.tar.gz
tm-scripts-b1abeeac19fc125391cf05198b714b01edd388cc.tar.xz
tm-scripts-b1abeeac19fc125391cf05198b714b01edd388cc.zip
[vmware] Delete stale redo files on xorg startup/reset
Diffstat (limited to 'remote/modules')
-rw-r--r--remote/modules/vmware/data/etc/X11/Xreset.d/vmware9
1 files changed, 8 insertions, 1 deletions
diff --git a/remote/modules/vmware/data/etc/X11/Xreset.d/vmware b/remote/modules/vmware/data/etc/X11/Xreset.d/vmware
index 19323da0..83bfb392 100644
--- a/remote/modules/vmware/data/etc/X11/Xreset.d/vmware
+++ b/remote/modules/vmware/data/etc/X11/Xreset.d/vmware
@@ -2,9 +2,16 @@
# VMWare cleanup
#
+# Unmount dirs that vmware sometimes leaves around
VMWARE_TMP_DIRS="$(cat /proc/mounts | grep "/tmp/vmware-" | awk -F " " '{print $1}')"
for DIR in $VMWARE_TMP_DIRS; do
- umount "$DIR"
+ umount "$DIR" && rmdir "$DIR"
done
+
+# Delete redo/temp files that sometimes stay around e.g. on vmware crash
+for file in $(find /tmp/virt/vmware -type f -size +4M); do
+ fuser -s "$file" || rm -- "$file"
+done
+
true