wallet: reorder services to stop to make it work even when wallet is not startet after logon
This commit is contained in:
@@ -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,24 +49,22 @@ 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
|
||||||
mkdir -p ${WALLETPATH}
|
mkdir -p ${WALLETPATH}
|
||||||
|
|||||||
Reference in New Issue
Block a user