mirrorlist: try a explicit removal if starting fails

Starting the mirrorlist container after a stop sometimes fails with:

Error: error creating container storage: the container name "mirrorlist1.service" is already in use

One way to work around this is to run:

sudo -u mirrormanager /usr/bin/podman rm mirrorlist1.service --storage --force

The restart mirrorlist container script now tries to remove the
container with '--storage --force' if the start fails and retries the
start.

Signed-off-by: Adrian Reber <adrian@lisas.de>
This commit is contained in:
Adrian Reber 2019-11-18 18:02:25 +01:00 committed by Pierre-Yves Chibon
parent fc25f8e40d
commit e8503d0d5a

View file

@ -78,8 +78,14 @@ systemctl stop mirrorlist1
sleep 1
systemctl start mirrorlist1
if [[ ${?} -ne 0 ]]; then
echo "Unable to start mirrorlist1"
exit 1
# We have seen this to fail because podman was not able to completely
# remove the container for some reason. First try this:
sudo -u mirrormanager /usr/bin/podman rm mirrorlist1.service --storage --force
systemctl start mirrorlist1
if [[ ${?} -ne 0 ]]; then
echo "Unable to start mirrorlist1"
exit 1
fi
fi