Skip to content

Commit

Permalink
baremetal: Use podman inspect to check ironic service status
Browse files Browse the repository at this point in the history
Some people are hitting issues where the containers appear running in
podman ps output, but are in fact unresponsive and podman exec/inspect
CLI options fail.

This may be a libpod bug (looking for related issues), but as a workaround
we can check the inspect status, which should mean we can detect zombie
containers and restart the ironic.service which appears to solve the
issue.

Related: openshift-metal3/dev-scripts#753
  • Loading branch information
Steven Hardy committed Aug 27, 2019
1 parent b8fd625 commit 7ce0f5c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ sudo podman run -d --net host --privileged --name ironic-api \
# The alternative would be RemainAfterExit=yes but then we lose the ability to restart if something crashes.
while true; do
for name in ironic-api ironic-conductor ironic-inspector dnsmasq httpd mariadb; do
podman ps | grep -w "$name$" || exit 1
# Note it would be nicer to use the --format option here but it breaks the go templating
# in the installer and escaping the template appears difficult
state=$(podman inspect ${name} --format {{ "{{.State.Status}}" }})
if [[ $state != "running" ]]; then
echo "ERROR: Unexpected service status for $name"
podman inspect ${name}
exit 1
fi
done
sleep 10
done

0 comments on commit 7ce0f5c

Please sign in to comment.