Skip to content

Commit ed6c70a

Browse files
authored
Pass exit code to s6-init (home-assistant#59545)
1 parent e512904 commit ed6c70a

File tree

1 file changed

+4
-0
lines changed
  • rootfs/etc/services.d/home-assistant

1 file changed

+4
-0
lines changed

rootfs/etc/services.d/home-assistant/finish

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ ifelse { s6-test ${1} -eq ${SIGNAL_EXIT_CODE} } {
1313
# Process terminated by a signal
1414
define signal ${2}
1515
foreground { s6-echo "[finish] process received signal ${signal}" }
16+
backtick -n new_exit_code { s6-expr 128 + ${signal} }
17+
importas -ui new_exit_code new_exit_code
18+
foreground { redirfd -w 1 /var/run/s6/env-stage3/S6_STAGE2_EXITED s6-echo -n -- ${new_exit_code} }
1619
if { s6-test ${signal} -ne ${SIGTERM} }
1720
s6-svscanctl -t /var/run/s6/services
1821
}
1922

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

0 commit comments

Comments
 (0)