Skip to content

Instantly share code, notes, and snippets.

@Roadmaster
Created October 26, 2017 16:05
Show Gist options
  • Save Roadmaster/3f9bee20193e3396cdebc57bede6ee37 to your computer and use it in GitHub Desktop.
Save Roadmaster/3f9bee20193e3396cdebc57bede6ee37 to your computer and use it in GitHub Desktop.
env PROMETHEUS=/usr/bin/prometheus
env CONFIG=/etc/prometheus/prometheus.yml
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 0755 $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 -- -config.file=$CONFIG \
-storage.local.path=/var/lib/prometheus/metrics \
-web.console.templates=/etc/prometheus/consoles \
-web.console.libraries=/etc/prometheus/console_libraries \
$ARGS
end script
respawn
respawn limit 10 10
kill timeout 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment