#! /bin/bash # QUI: Script écrit par JB. Il doit être lancé avec le(s) compte(s) utilisateur(s) exécutant des containers podman. # QUOI: Voir le ticket #03618727 # POURQUOI: Bug indispo podman après reboot si certains paquets tels que podman, setup... ont été mis à jour. # QUAND: Script lancé au boot # COMMENT: Avec une crontab tel que : # '@reboot /var/lib/awx/scripts/autofix_podman_system_migrate.sh' # ou si cron root '@reboot sudo -u awx -i /var/lib/awx/scripts/autofix_podman_system_migrate.sh' # ou encore avec SystemD if podman ps 2>&1 | grep -q 'podman system migrate' then podman system migrate # Fix containers still in Stopping state if [[ "$USER" == 'awx' ]] then sleep 1 podman rm -f "$(podman ps -a | grep -v 'seconds' | awk '/Stopping/ {print $1}')" 2>/dev/null || true fi fi