Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
0e985284
Commit
0e985284
authored
2 years ago
by
nojocodex
Committed by
Paulus Schoutsen
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix logging & exit code reporting to S6 on HA shutdown (#72921)
parent
12e6f143
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rootfs/etc/services.d/home-assistant/finish
+8
-8
8 additions, 8 deletions
rootfs/etc/services.d/home-assistant/finish
with
8 additions
and
8 deletions
rootfs/etc/services.d/home-assistant/finish
+
8
−
8
View file @
0e985284
...
...
@@ -2,24 +2,24 @@
# ==============================================================================
# Take down the S6 supervision tree when Home Assistant fails
# ==============================================================================
declare RESTART_EXIT_CODE
100
declare SIGNAL_EXIT_CODE
256
declare SIGTERM
15
declare RESTART_EXIT_CODE
=
100
declare SIGNAL_EXIT_CODE
=
256
declare SIGTERM
=
15
declare APP_EXIT_CODE=${1}
declare S
YS_EXIT_CODE
=${2
+x
}
declare S
IGNAL_NO
=${2}
declare NEW_EXIT_CODE=
bashio::log.info "Home Assistant Core finish process exit code ${
1
}"
bashio::log.info "Home Assistant Core finish process exit code ${
APP_EXIT_CODE
}"
if [[ ${APP_EXIT_CODE} -eq ${RESTART_EXIT_CODE} ]]; then
exit 0
elif [[ ${APP_EXIT_CODE} -eq ${SIGNAL_EXIT_CODE} ]]; then
bashio::log.info "Home Assistant Core finish process received signal ${
APP_EXIT_CODE
}"
bashio::log.info "Home Assistant Core finish process received signal ${
SIGNAL_NO
}"
NEW_EXIT_CODE=$((128 + S
YS_EXIT_CODE
))
NEW_EXIT_CODE=$((128 + S
IGNAL_NO
))
echo ${NEW_EXIT_CODE} > /run/s6-linux-init-container-results/exitcode
if [[ ${
NEW_EXIT_CODE
} -eq ${SIGTERM} ]]; then
if [[ ${
SIGNAL_NO
} -eq ${SIGTERM} ]]; then
/run/s6/basedir/bin/halt
fi
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment