summaryrefslogtreecommitdiffstats
path: root/core/modules/vmware/data/etc/X11/Xreset.d/vmware
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/vmware/data/etc/X11/Xreset.d/vmware')
-rw-r--r--core/modules/vmware/data/etc/X11/Xreset.d/vmware17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/modules/vmware/data/etc/X11/Xreset.d/vmware b/core/modules/vmware/data/etc/X11/Xreset.d/vmware
new file mode 100644
index 00000000..83bfb392
--- /dev/null
+++ b/core/modules/vmware/data/etc/X11/Xreset.d/vmware
@@ -0,0 +1,17 @@
+#
+# 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" && 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
+