Skip to content

Commit

Permalink
Pass exit code to s6-init (home-assistant#59545)
Browse files Browse the repository at this point in the history
  • Loading branch information
agners authored Nov 14, 2021
1 parent e512904 commit ed6c70a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rootfs/etc/services.d/home-assistant/finish
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ ifelse { s6-test ${1} -eq ${SIGNAL_EXIT_CODE} } {
# Process terminated by a signal
define signal ${2}
foreground { s6-echo "[finish] process received signal ${signal}" }
backtick -n new_exit_code { s6-expr 128 + ${signal} }
importas -ui new_exit_code new_exit_code
foreground { redirfd -w 1 /var/run/s6/env-stage3/S6_STAGE2_EXITED s6-echo -n -- ${new_exit_code} }
if { s6-test ${signal} -ne ${SIGTERM} }
s6-svscanctl -t /var/run/s6/services
}

foreground { redirfd -w 1 /var/run/s6/env-stage3/S6_STAGE2_EXITED s6-echo -n -- ${1} }
s6-svscanctl -t /var/run/s6/services

0 comments on commit ed6c70a

Please sign in to comment.