Skip to content

Commit 9f32460

Browse files
authored
Fix finish script for s6 v3 (#115)
* Fix finish script for s6 v3 * Wrong shebang
1 parent 174fed5 commit 9f32460

File tree

1 file changed

+10
-4
lines changed
  • rootfs/etc/services.d/coredns

1 file changed

+10
-4
lines changed
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
#!/usr/bin/execlineb -S1
1+
#!/usr/bin/env bashio
22
# ==============================================================================
33
# Take down the S6 supervision tree when CoreDNS fails
4+
# s6-overlay docs: https://github.com/just-containers/s6-overlay
45
# ==============================================================================
5-
if { s6-test ${1} -ne 0 }
6-
if { s6-test ${1} -ne 256 }
6+
declare APP_EXIT_CODE=${1}
77

8-
s6-svscanctl -t /var/run/s6/services
8+
if [[ "${APP_EXIT_CODE}" -ne 0 ]] && [[ "${APP_EXIT_CODE}" -ne 256 ]]; then
9+
bashio::log.warning "Halt DNS plug-in with exit code ${APP_EXIT_CODE}"
10+
echo "${APP_EXIT_CODE}" > /run/s6-linux-init-container-results/exitcode
11+
exec /run/s6/basedir/bin/halt
12+
fi
13+
14+
bashio::log.info "Service restart after closing"

0 commit comments

Comments
 (0)