void-packages/srcpkgs/node_exporter/files/node_exporter/run

14 lines
516 B
Bash
Executable File

#!/bin/sh
# Add $ARGS for more arguments to node_exporter
[ -f ./conf ] && . ./conf
: ${RUNIT_COLLECTOR:='--collector.runit --collector.runit.servicedir /var/service'}
[ -n "${LISTEN_ADDR}" ] && LISTEN_ADDR="--web.listen-address ${LISTEN_ADDR}"
# Not by default since the runit collector needs root, no magic group for runit access.
[ -n "${USE_LOCAL_USER}" ] && : ${USER:=_node_exporter}
[ -n "${USER}" ] && CHPST_USER="-u ${USER}"
exec chpst $CHPST_USER node_exporter ${RUNIT_COLLECTOR} ${LISTEN_ADDR} ${ARGS}