31 lines
857 B
Text
31 lines
857 B
Text
|
# Prometheus Haproxy exporter (Upstart unit)
|
||
|
description "Prometheus Haproxy exporter"
|
||
|
start on runlevel [2345]
|
||
|
stop on runlevel [06]
|
||
|
|
||
|
env HAPROXY_EXPORTER=/usr/bin/haproxy_exporter
|
||
|
env USER=prometheus
|
||
|
env GROUP=prometheus
|
||
|
env DEFAULTS=/etc/default/haproxy_exporter
|
||
|
env RUNDIR=/var/run/haproxy_exporter
|
||
|
env PID_FILE=/var/run/haproxy_exporter/haproxy_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/haproxy_exporter", if available.
|
||
|
[ -e $DEFAULTS ] && . $DEFAULTS
|
||
|
|
||
|
export GOMAXPROCS=${GOMAXPROCS:-2}
|
||
|
exec start-stop-daemon -c $USER -g $GROUP -p $PID_FILE -x $HAPROXY_EXPORTER -S -- $ARGS
|
||
|
end script
|
||
|
|
||
|
respawn
|
||
|
respawn limit 10 10
|
||
|
kill timeout 10
|