Improved cleanup of Sanity/sanity-test

Ensure no process is left running as BUILD_USER
This commit is contained in:
Jan Kurik 2021-07-07 08:39:19 +02:00
parent 01a7e08d4d
commit 610c731b84
1 changed files with 7 additions and 1 deletions

View File

@ -81,7 +81,13 @@ rlJournalStart
rlPhaseEnd
rlPhaseStartCleanup
[[ "${del}" == "yes" ]] && rlRun "userdel -r ${BUILD_USER}"
if [[ "${del}" == "yes" ]]; then
rlRun "pkill --signal SIGTERM -u ${BUILD_USER}" 0-255
sleep 3
rlRun "pkill --signal SIGKILL -u ${BUILD_USER}" 0-255
sleep 1
rlRun "userdel -rf ${BUILD_USER}" 0-255
fi
rlRun "popd"
rlRun "rm -r ${TmpDir}" 0 "Removing tmp directory"
rlPhaseEnd