remove pidfile correctly
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
f 2022-05-02 15:42:04 -03:00
parent 4e5a259482
commit 7c32c040c4
1 changed files with 7 additions and 3 deletions

View File

@ -2,11 +2,15 @@
set -e
STATS=${STATS:-/tmp/stats.yaml}
pid=/tmp/prometheus.pid
case $1 in
start)
rm -f /tmp/prometheus.pid
daemonize -c /tmp -p /tmp/prometheus.pid -l /tmp/prometheus.pid -u knot /usr/bin/knot-prometheus-exporter ${STATS}
test -f $tmp && echo "prometheus-exporter already running"
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