wallet: reorder services to stop to make it work even when wallet is not startet after logon

This commit is contained in:
Daniel Pätzold
2026-03-31 20:00:33 +02:00
parent 51481cd022
commit e96930d16e
+11 -12
View File
@@ -37,6 +37,7 @@ WALLETPATH="${DECRYPTEDDATADIR}/kwallet"
WALLETPATH_CFG="$SUDO_HOME/.local/share/kwalletd" WALLETPATH_CFG="$SUDO_HOME/.local/share/kwalletd"
# Stop the daemon anyway if running # 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 ) WALLET_PID=$( pgrep -u $SUDO_USER kwalletd6 )
if [[ ! -z ${WALLET_PID} ]]; then if [[ ! -z ${WALLET_PID} ]]; then
MANAGER_PID=$( pgrep -u $SUDO_USER kwalletmanager5 ) MANAGER_PID=$( pgrep -u $SUDO_USER kwalletmanager5 )
@@ -48,23 +49,21 @@ if [[ ! -z ${WALLET_PID} ]]; then
exit 1 exit 1
fi fi
fi fi
SECTRETS_PID=$( pgrep -u $SUDO_USER ksecretd ) kill ${WALLET_PID} && sleep 0.5 && echo "Service kwalletd6 (${WALLET_PID}) was stopped."
if [[ ! -z ${SECTRETS_PID} ]]; then
echo "Stopping ksecretd with PID ${SECTRETS_PID}"
kill ${SECTRETS_PID}
if [[ $? -ne 0 ]]; then
echo "Service could not be stopped, please check why."
exit 1
fi
fi
kill ${WALLET_PID} && sleep 0.5 && echo "Service kwalletd6 (${WALLET_PID}) was stopped too."
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "Kwallet Service could not be stopped, please check why." echo "Kwallet Service could not be stopped, please check why."
exit 1 exit 1
fi fi
else fi
echo "Service kwalletd6 not found to be stopped. Please check why." # ksecret is the basic daemon now, it needs to be stopped last
SECTRETS_PID=$( pgrep -u $SUDO_USER ksecretd )
if [[ ! -z ${SECTRETS_PID} ]]; then
echo "Stopping ksecretd with PID ${SECTRETS_PID}"
kill ${SECTRETS_PID} && sleep 0.5
if [[ $? -ne 0 ]]; then
echo "Service could not be stopped, please check why."
exit 1 exit 1
fi
fi fi
#Setup encrypted path if not existing already #Setup encrypted path if not existing already