Skip to content

Commit

Permalink
Merge pull request #215 from mdegat01/fix-finish-script
Browse files Browse the repository at this point in the history
Set exit code in finish script
  • Loading branch information
mdegat01 authored Aug 30, 2022
2 parents 4edaa88 + cc33246 commit a09888b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions promtail/rootfs/etc/services.d/promtail/finish
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
# Take down the S6 supervision tree when Promtail fails
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt add-on"

declare APP_EXIT_CODE=${1}

if [[ "${APP_EXIT_CODE}" -ne 0 ]] && [[ "${APP_EXIT_CODE}" -ne 256 ]]; then
bashio::log.warning "Halt add-on with exit code ${APP_EXIT_CODE}"
echo "${APP_EXIT_CODE}" > /run/s6-linux-init-container-results/exitcode
exec /run/s6/basedir/bin/halt
fi

Expand Down

0 comments on commit a09888b

Please sign in to comment.