diff --git a/srcpkgs/node_exporter/files/node_exporter/run b/srcpkgs/node_exporter/files/node_exporter/run index 7bb3278b611..f7f6d4865e7 100755 --- a/srcpkgs/node_exporter/files/node_exporter/run +++ b/srcpkgs/node_exporter/files/node_exporter/run @@ -3,8 +3,11 @@ # Add $ARGS for more arguments to node_exporter [ -f ./conf ] && . ./conf -: ${USER:=_node_exporter} : ${RUNIT_COLLECTOR:='--collector.runit --collector.runit.servicedir /var/service'} -[ -n "$LISTEN_ADDR" ] && LISTEN_ADDR="--web.listen-address ${LISTEN_ADDR}" +[ -n "${LISTEN_ADDR}" ] && LISTEN_ADDR="--web.listen-address ${LISTEN_ADDR}" -exec chpst -u $USER node_exporter ${RUNIT_COLLECTOR} ${LISTEN_ADDR} ${ARGS} +# 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} diff --git a/srcpkgs/node_exporter/template b/srcpkgs/node_exporter/template index 184a596039a..c76ea49f6d3 100644 --- a/srcpkgs/node_exporter/template +++ b/srcpkgs/node_exporter/template @@ -1,7 +1,7 @@ # Template file for 'node_exporter' pkgname=node_exporter version=0.15.2 -revision=2 +revision=3 build_style=go go_import_path="github.com/prometheus/node_exporter" go_ldflags="-X ${go_import_path}/version.Version=${version}