Skip to content

Commit

Permalink
health - remove logs and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lmagyar committed Feb 22, 2025
1 parent fc27de2 commit 13ad75e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
13 changes: 0 additions & 13 deletions tailscale/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,6 @@ CGNAT networks). You can test connections with `tailscale ping

When not set, an automatically selected port is used by default.

## Healthcheck

Tailscale is quite resilient and can recover from nearly any network change. In
case it fails to recover, the add-on's health is set unhealthy. The add-on's
health is checked by Home Assistant in each 30s, and if it reports itself 3
times unhealthy in a row, the add-on will be restarted.

The add-on's health is set unhealthy:

- Once it was online and gets offline for longer than 5 minutes.

- After a (re)start can't get online for longer than 1 hour.

## Changelog & Releases

This repository keeps a change log using [GitHub's releases][releases]
Expand Down
14 changes: 0 additions & 14 deletions tailscale/rootfs/usr/bin/healthcheck
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# - .BackendState == "Stopped"
# - if once was online but gets offline for more then HEALTHCHECK_OFFLINE_TIMEOUT seconds
# - if never gets online for more then HEALTHCHECK_RESTART_TIMEOUT seconds
# This can handle internal TS bugs, like https://github.com/tailscale/tailscale/issues/12021 where TS fails to recover from rerouting traffic from normal WAN to failover WAN

# Redirect healthchecks' output to the log
exec &> /proc/1/fd/1
Expand All @@ -19,7 +18,6 @@ declare status_json
declare backend_state is_self_online
# STARTED_TIMESTAMP is in contenv at /var/run/s6/container_environment
# LAST_ONLINE_TIMESTAMP is in contenv at /var/run/s6/container_environment
# LAST_REPORTED_HEALTH_STATE is in contenv at /var/run/s6/container_environment

if ! bashio::var.has_value "${STARTED_TIMESTAMP-}"
then
Expand All @@ -44,17 +42,5 @@ if [[ "${backend_state}" == "Stopped" ]] || \
(( $(date +"%s") - ${STARTED_TIMESTAMP} > ${HEALTHCHECK_RESTART_TIMEOUT} )) )
then
# Unhealthy
if ! bashio::var.equals "${LAST_REPORTED_HEALTH_STATE-}" "UNHEALTHY"; then
printf "UNHEALTHY" > /var/run/s6/container_environment/LAST_REPORTED_HEALTH_STATE
fi
# Log it always
bashio::log.fatal "Add-on is unhealthy"
bashio::exit.nok
else
# Healthy
if ! bashio::var.equals "${LAST_REPORTED_HEALTH_STATE-}" "HEALTHY"; then
printf "HEALTHY" > /var/run/s6/container_environment/LAST_REPORTED_HEALTH_STATE
# Log it only once
bashio::log.info "Add-on is healthy"
fi
fi

0 comments on commit 13ad75e

Please sign in to comment.