Skip to content

Commit

Permalink
Add set -e to all the entrypoint scripts
Browse files Browse the repository at this point in the history
I noticed that it's possible for the dbsync in the conductor script
to fail (if mariadb is not yet up), which is silently ignored and
results in a broken Ironic.

It's probably one of many possible failures, so lets set -e so containers
exit when an error happens, which allows for automated restart e.g
via k8s or systemd.
  • Loading branch information
Steven Hardy committed Jul 25, 2019
1 parent 85abc5a commit 7e7eb9a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rundnsmasq.sh
@@ -1,5 +1,7 @@
#!/usr/bin/bash

set -e

PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"}

HTTP_PORT=${HTTP_PORT:-"80"}
Expand Down
2 changes: 2 additions & 0 deletions runhttpd.sh
@@ -1,5 +1,7 @@
#!/usr/bin/bash

set -e

PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"}
HTTP_PORT=${HTTP_PORT:-"80"}
HTTP_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1)
Expand Down
2 changes: 2 additions & 0 deletions runironic-api.sh
@@ -1,5 +1,7 @@
#!/usr/bin/bash

set -e

. /bin/configure-ironic.sh

# Allow access to Ironic
Expand Down
2 changes: 2 additions & 0 deletions runironic-conductor.sh
@@ -1,5 +1,7 @@
#!/usr/bin/bash

set -e

. /bin/configure-ironic.sh

# Allow access to mDNS
Expand Down
3 changes: 3 additions & 0 deletions runmariadb.sh
@@ -1,4 +1,7 @@
#!/usr/bin/bash

set -e

PATH=$PATH:/usr/sbin/
DATADIR="/var/lib/mysql"
MARIADB_PASSWORD=${MARIADB_PASSWORD:-"change_me"}
Expand Down

0 comments on commit 7e7eb9a

Please sign in to comment.