fix: don't leave lockfiles hanging around

This commit is contained in:
f 2022-11-23 12:34:02 -03:00
parent 38c39af601
commit 815f9b23d8
2 changed files with 5 additions and 9 deletions

View file

@ -4,7 +4,7 @@ pipeline:
settings: settings:
registry: registry.nulo.in registry: registry.nulo.in
username: sutty username: sutty
repo: registry.nulo.in/sutty/CHANGEME repo: registry.nulo.in/sutty/prometheus
tags: tags:
- ${ALPINE_VERSION} - ${ALPINE_VERSION}
- latest - latest

View file

@ -5,19 +5,15 @@ var=/var/lib/prometheus
case $1 in case $1 in
stop) stop)
test -f "${pid}" || exit 0 test ! -f $pid || cat ${pid} | xargs -r kill
rm -f ${pid}
cat "${pid}" | xargs -r kill
rm "${pid}"
;; ;;
start) start)
rm -f "${pid}" chown -R prometheus:prometheus "${var}"
chown prometheus:prometheus "${var}"
chmod -R u=rwX,g=rX,o= "${var}" chmod -R u=rwX,g=rX,o= "${var}"
daemonize -p "${pid}" -l "${pid}" -u prometheus -c "${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" /usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path="${var}/data"
;; ;;
esac esac