formula-prometheus-ng/prometheus/files/blackbox_exporter.upstart.jinja
2016-12-12 12:43:05 +00:00

30 lines
867 B
Django/Jinja

# Prometheus Blackbox exporter (Upstart unit)
description "Prometheus Blackbox exporter"
start on runlevel [2345]
stop on runlevel [06]
env BLACKBOX_EXPORTER=/usr/bin/blackbox_exporter
env USER=prometheus
env GROUP=prometheus
env DEFAULTS=/etc/default/blackbox_exporter
env RUNDIR=/var/run/blackbox_exporter
env PID_FILE=/var/run/blackbox_exporter/blackbox_exporter.pid
pre-start script
[ -e $DEFAULTS ] && . $DEFAULTS
mkdir -p $RUNDIR || true
chmod 0750 $RUNDIR || true
chown $USER:$GROUP $RUNDIR || true
end script
script
# read settings like GOMAXPROCS from "/etc/default/blackbox_exporter", if available.
[ -e $DEFAULTS ] && . $DEFAULTS
export GOMAXPROCS=${GOMAXPROCS:-2}
exec start-stop-daemon -c $USER -g $GROUP -p $PID_FILE -x $BLACKBOX_EXPORTER -S -- $ARGS
end script
respawn
respawn limit 10 10
kill timeout 10