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