remove pidfile correctly
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
4e5a259482
commit
7c32c040c4
1 changed files with 7 additions and 3 deletions
|
@ -2,11 +2,15 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
STATS=${STATS:-/tmp/stats.yaml}
|
STATS=${STATS:-/tmp/stats.yaml}
|
||||||
|
pid=/tmp/prometheus.pid
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
start)
|
start)
|
||||||
rm -f /tmp/prometheus.pid
|
test -f $tmp && echo "prometheus-exporter already running"
|
||||||
daemonize -c /tmp -p /tmp/prometheus.pid -l /tmp/prometheus.pid -u knot /usr/bin/knot-prometheus-exporter ${STATS}
|
daemonize -c /tmp -p $tmp -l $tmp -u knot /usr/bin/knot-prometheus-exporter ${STATS}
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
test -f $tmp && cat $tmp | xargs -r kill
|
||||||
|
rm -f $tmp
|
||||||
;;
|
;;
|
||||||
stop) cat /tmp/prometheus.pid | xargs -r kill ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue