From b32cc96ca0e5902c9a64a6c79cc38eedf33ce80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Mon, 11 May 2026 12:01:08 +0200 Subject: [PATCH] kwallet: stop kwalletd6-logon.service before remounting wallet ExecStop (umount) fires asynchronously ~26s after logout, by which time a second login's install.sh has already remounted the wallet. ExecStop then unmounts the fresh mount, leaving kwalletd6 without the wallet directory. Fix: stop kwalletd6-logon.service at the top of install.sh so its ExecStop fires and drains before the remount, eliminating the race. Co-Authored-By: Claude Sonnet 4.6 --- client_software/0010_kwallet/install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client_software/0010_kwallet/install.sh b/client_software/0010_kwallet/install.sh index 0c7f78e..1461054 100755 --- a/client_software/0010_kwallet/install.sh +++ b/client_software/0010_kwallet/install.sh @@ -39,6 +39,12 @@ WALLETFILE="${WALLETNAME}.kwl" WALLETPATH="${DECRYPTEDDATADIR}/kwallet" WALLETPATH_CFG="$SUDO_HOME/.local/share/kwalletd" +# Stop kwalletd6-logon.service first so its ExecStop (umount) fires before we remount the wallet. +# Without this, ExecStop races with the remount below and can unmount the freshly mounted wallet. +_USER_UID=$(id -u "${SUDO_USER}") +XDG_RUNTIME_DIR="/run/user/${_USER_UID}" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${_USER_UID}/bus" \ + sudo -u "${SUDO_USER}" systemctl --user stop kwalletd6-logon.service 2>/dev/null || true + # Stop the daemon anyway if running # kwallet and kwalletmanager are optional and only started when an app has been using them already WALLET_PID=$( pgrep -u $SUDO_USER kwalletd6 )