mirror of
https://github.com/hassio-addons/addon-prometheus.git
synced 2025-05-05 11:41:38 +00:00
⬆️ Upgrades add-on base image to 12.0.0
This commit is contained in:
parent
844a3a4985
commit
882efcb1cf
9 changed files with 32 additions and 24 deletions
6
prometheus/rootfs/etc/cont-init.d/prometheus.sh
Normal file → Executable file
6
prometheus/rootfs/etc/cont-init.d/prometheus.sh
Normal file → Executable file
|
@ -1,6 +1,10 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
#!/command/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Prometheus
|
||||
# Configures Prometheus
|
||||
# ==============================================================================
|
||||
echo "${SUPERVISOR_TOKEN}" > '/run/home-assistant.token'
|
||||
|
||||
mkdir -p /data/prometheus
|
||||
find /data/prometheus -not -perm 0644 -type f -exec chmod 0660 {} \;
|
||||
find /data/prometheus -not -perm 0755 -type d -exec chmod 0770 {} \;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
/data/prometheus true prometheus 0660 0770
|
10
prometheus/rootfs/etc/services.d/prometheus-configgen/finish
Normal file → Executable file
10
prometheus/rootfs/etc/services.d/prometheus-configgen/finish
Normal file → Executable file
|
@ -1,9 +1,11 @@
|
|||
#!/usr/bin/execlineb -S0
|
||||
#!/command/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Prometheus
|
||||
# Take down the S6 supervision tree when Prometheus fails
|
||||
# ==============================================================================
|
||||
if { s6-test ${1} -ne 0 }
|
||||
if { s6-test ${1} -ne 256 }
|
||||
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
||||
bashio::log.warning "Prometheus config crashed, halting add-on"
|
||||
exec /run/s6/basedir/bin/halt
|
||||
fi
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
bashio::log.info "Prometheus config stopped, restarting..."
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
#!/command/with-contenv bashio
|
||||
bashio::log.info 'Starting prometheus config generator...'
|
||||
|
||||
if ! bashio::fs.directory_exists /share/prometheus/targets; then
|
||||
|
|
10
prometheus/rootfs/etc/services.d/prometheus/finish
Normal file → Executable file
10
prometheus/rootfs/etc/services.d/prometheus/finish
Normal file → Executable file
|
@ -1,9 +1,11 @@
|
|||
#!/usr/bin/execlineb -S0
|
||||
#!/command/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Prometheus
|
||||
# Take down the S6 supervision tree when Prometheus fails
|
||||
# ==============================================================================
|
||||
if { s6-test ${1} -ne 0 }
|
||||
if { s6-test ${1} -ne 256 }
|
||||
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
||||
bashio::log.warning "Prometheus crashed, halting add-on"
|
||||
exec /run/s6/basedir/bin/halt
|
||||
fi
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
bashio::log.info "Prometheus stopped, restarting..."
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
#!/command/with-contenv bashio
|
||||
# shellcheck disable=SC2191
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Prometheus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue