Skip to content

Commit

Permalink
Stop the Home Assistant Core container by default
Browse files Browse the repository at this point in the history
When Home Assistant Core crashes (e.g. due to SIGILL, signal number 4)
as caused by #101027) the container should exit. This makes sure that
the exit code can be read by container orchistration software such as
the Supervisor and act upon.

With this, the Supervisor properly rolls back Home Assistant Core to the
previously installed version.

See also home-assistant/supervisor#4590 (comment).
  • Loading branch information
agners committed Sep 29, 2023
1 parent 809abc1 commit 794a910
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions rootfs/etc/services.d/home-assistant/finish
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ elif [[ ${APP_EXIT_CODE} -eq ${SIGNAL_EXIT_CODE} ]]; then

NEW_EXIT_CODE=$((128 + SIGNAL_NO))
echo ${NEW_EXIT_CODE} > /run/s6-linux-init-container-results/exitcode

if [[ ${SIGNAL_NO} -eq ${SIGTERM} ]]; then
/run/s6/basedir/bin/halt
fi
else
bashio::log.info "Home Assistant Core service shutdown"

echo ${APP_EXIT_CODE} > /run/s6-linux-init-container-results/exitcode
/run/s6/basedir/bin/halt
fi

# Make sure to stop the container
/run/s6/basedir/bin/halt

0 comments on commit 794a910

Please sign in to comment.