summaryrefslogtreecommitdiffstats
path: root/core/modules/pam-slx-plug
diff options
context:
space:
mode:
authorSimon Rettberg2021-10-29 14:35:52 +0200
committerSimon Rettberg2021-10-29 14:35:52 +0200
commit08d085cbd56ba9dd0e3f347df085a2da336925a4 (patch)
tree7f21d24e09ad45a36e6d0dc7d9bf7f2763fad86e /core/modules/pam-slx-plug
parent[libvirt-src] Properly fix failing build with docs enabled (diff)
downloadmltk-08d085cbd56ba9dd0e3f347df085a2da336925a4.tar.gz
mltk-08d085cbd56ba9dd0e3f347df085a2da336925a4.tar.xz
mltk-08d085cbd56ba9dd0e3f347df085a2da336925a4.zip
[pam-slx-plug] Unmount doubly-mounted home directory
Diffstat (limited to 'core/modules/pam-slx-plug')
-rw-r--r--core/modules/pam-slx-plug/data/opt/openslx/pam/mount.d/99-fallback6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/modules/pam-slx-plug/data/opt/openslx/pam/mount.d/99-fallback b/core/modules/pam-slx-plug/data/opt/openslx/pam/mount.d/99-fallback
index 695dccaa..b0ef8707 100644
--- a/core/modules/pam-slx-plug/data/opt/openslx/pam/mount.d/99-fallback
+++ b/core/modules/pam-slx-plug/data/opt/openslx/pam/mount.d/99-fallback
@@ -88,6 +88,12 @@ if [ -n "$PIDS" ]; then
kill -9 $PIDS # Kill any leftovers; No quotes
fi
+# In rare cases we end up with a race condition that leads to two mounts
+while [ "$( grep -c -F " ${PERSISTENT_HOME_DIR} " "/proc/mounts" )" -gt 1 ]; do
+ umount "${PERSISTENT_HOME_DIR}" || break
+ usleep 100000 # 100ms
+done
+
# Only if SHARE_NO_HOME_WARN is empty or 0
if [ -z "${SHARE_NO_HOME_WARN%0}" ] && ! isHomeMounted; then
LOG_COMBINED=$(mktemp)