forked from voxpupuli/puppet-prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprometheus.upstart.erb
31 lines (26 loc) · 1.05 KB
/
prometheus.upstart.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Prometheus Monitoring Framework (Upstart unit)
description "Prometheus Monitoring Framework"
start on runlevel [2345]
stop on runlevel [06]
env PROMETHEUS=<%= scope.lookupvar('prometheus::server::bin_dir') %>/prometheus
env USER=<%= scope.lookupvar('prometheus::server::user') %>
env GROUP=<%= scope.lookupvar('prometheus::server::group') %>
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 --chuid $USER --group $GROUP --pidfile $PID_FILE --exec $PROMETHEUS --start -- <%= @daemon_flags.join(" \\\n ") %> \
<%= scope.lookupvar('prometheus::server::extra_options') %>
end script
respawn
respawn limit 10 10
kill timeout 10