forked from obel1x/fedora-OEMDRV
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"
|
||||
|
||||
# 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 )
|
||||
if [[ ! -z ${WALLET_PID} ]]; then
|
||||
MANAGER_PID=$( pgrep -u $SUDO_USER kwalletmanager5 )
|
||||
@@ -48,24 +49,22 @@ if [[ ! -z ${WALLET_PID} ]]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
SECTRETS_PID=$( pgrep -u $SUDO_USER ksecretd )
|
||||
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."
|
||||
kill ${WALLET_PID} && sleep 0.5 && echo "Service kwalletd6 (${WALLET_PID}) was stopped."
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Kwallet Service could not be stopped, please check why."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Service kwalletd6 not found to be stopped. Please check why."
|
||||
fi
|
||||
# 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
|
||||
fi
|
||||
fi
|
||||
|
||||
#Setup encrypted path if not existing already
|
||||
mkdir -p ${WALLETPATH}
|
||||
|
||||
Reference in New Issue
Block a user