From 815f9b23d85e1998ffe8e6bb620cafd4b607a911 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 23 Nov 2022 12:34:02 -0300 Subject: [PATCH] fix: don't leave lockfiles hanging around --- .woodpecker.yml | 2 +- prometheusd.sh | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 0047271..16af47f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,7 +4,7 @@ pipeline: settings: registry: registry.nulo.in username: sutty - repo: registry.nulo.in/sutty/CHANGEME + repo: registry.nulo.in/sutty/prometheus tags: - ${ALPINE_VERSION} - latest diff --git a/prometheusd.sh b/prometheusd.sh index 6fee544..b9b4e2f 100755 --- a/prometheusd.sh +++ b/prometheusd.sh @@ -5,19 +5,15 @@ var=/var/lib/prometheus case $1 in stop) - test -f "${pid}" || exit 0 - - cat "${pid}" | xargs -r kill - - rm "${pid}" + test ! -f $pid || cat ${pid} | xargs -r kill + rm -f ${pid} ;; start) - rm -f "${pid}" - - chown prometheus:prometheus "${var}" + chown -R prometheus:prometheus "${var}" chmod -R u=rwX,g=rX,o= "${var}" daemonize -p "${pid}" -l "${pid}" -u prometheus -c "${var}" \ + /usr/local/bin/syslogize \ /usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path="${var}/data" ;; esac