5e0f268962
ExecStop on the user service caused an unmount race: it fired asynchronously after logout while the next login's install.sh had already remounted the wallet, then unmounted it again leaving kwalletd6 without its wallet directory. install.sh already handles umount/remount at login start, so no ExecStop is needed. On gocryptfs systems the wallet becomes inaccessible at logout naturally when ~/data is unmounted. user_run.sh now explicitly stops any leftover kwalletd6-logon unit from a previous session before creating a new one, avoiding the systemd-run unit-name-conflict failure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
54 lines
1.8 KiB
Bash
Executable File
54 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
# Restart and test Kwallet- Service
|
|
|
|
#Check Token
|
|
if [ "${DAVTOKEN_USER}." == "." ]; then
|
|
echo "Error: Script cannot be executed standalone and needs a prereserved environment from sync_client_software.sh. Quit."
|
|
exit 1
|
|
fi
|
|
|
|
|
|
# Vars
|
|
WALLETAPPID="sys_config_wallet_script"
|
|
WALLETNAME="kdewallet"
|
|
|
|
if [[ -z $(wmctrl -m | grep "KWin") ]]; then
|
|
# No KDE here - Cinnamon in Test
|
|
exit 0
|
|
fi
|
|
|
|
#Restart the service
|
|
# Stop any leftover unit from a previous session before creating a new one
|
|
systemctl --user stop kwalletd6-logon.service 2>/dev/null || true
|
|
systemd-run --user --unit=kwalletd6-logon \
|
|
--property=RemainAfterExit=yes \
|
|
--property=SuccessExitStatus=1 \
|
|
kwalletd6 >${TEMPDIR}/kwalletd6.log 2>&1 &
|
|
sleep 1
|
|
|
|
#Check if kwalletd is enabled now
|
|
for i in $(seq 1 4); do
|
|
QB_RESULT=$( $(dirname $0)/qbus_wallet_exec.sh isEnabled )
|
|
if [[ "$QB_RESULT" == "true" ]]; then
|
|
break
|
|
fi
|
|
sleep 2
|
|
done
|
|
if [[ "$QB_RESULT" != "true" ]]; then
|
|
echo "Error checking if kWallet service is activated. Please Check yourself what is wrong. Return of Check was:"
|
|
echo "$QB_RESULT"
|
|
exit 0
|
|
fi
|
|
|
|
#It should be possible to open the wallet without having to enter the password now.
|
|
echo "Checking if Wallet can be opened by the user. The Program should not ask for a password, maybe for confirmation to access the wallet which is ok."
|
|
echo "Please check to NOT have any Password asked now - if so, open kwalletmanager and change the password for wallet ${WALLETNAME} to nothing (by entering nothing when asked for new password)!"
|
|
QB_RESULT=$( $(dirname $0)/qbus_wallet_exec.sh open ${WALLETNAME} 0 $WALLETAPPID )
|
|
if [[ $? -ne 0 ]]; then
|
|
echo "Some Error opening Wallet ${WALLETNAME}. Please check."
|
|
exit 1
|
|
fi
|
|
echo "Sucessfully opened Wallet ${WALLETNAME} with ID ${QB_RESULT}. All is fine."
|
|
|
|
exit 0
|