Skip to content

Commit 6318c72

Browse files
Merge pull request #2249 from hardys/ironic_restart
Bug 1745004: baremetal: Use podman inspect to check ironic service status
2 parents b0abc58 + 7ce0f5c commit 6318c72

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

data/data/bootstrap/baremetal/files/usr/local/bin/startironic.sh.template

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,14 @@ sudo podman run -d --net host --privileged --name ironic-api \
112112
# The alternative would be RemainAfterExit=yes but then we lose the ability to restart if something crashes.
113113
while true; do
114114
for name in ironic-api ironic-conductor ironic-inspector dnsmasq httpd mariadb; do
115-
podman ps | grep -w "$name$" || exit 1
115+
# Note it would be nicer to use the --format option here but it breaks the go templating
116+
# in the installer and escaping the template appears difficult
117+
state=$(podman inspect ${name} --format {{ "{{.State.Status}}" }})
118+
if [[ $state != "running" ]]; then
119+
echo "ERROR: Unexpected service status for $name"
120+
podman inspect ${name}
121+
exit 1
122+
fi
116123
done
117124
sleep 10
118125
done

0 commit comments

Comments
 (0)