From c7615afb9ad53efb0bfc3741614e1eb464e1deb8 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 9 Jul 2022 23:21:11 -0300 Subject: [PATCH] correctly remove prometheus temp/lock file --- entrypoint.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index aad8eea..218e5c8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,8 +18,6 @@ case $1 in ;; prometheus) - rm -f /tmp/prometheus.pid - daemonize -c /srv \ -p /tmp/prometheus.pid \ -l /tmp/prometheus.pid \ @@ -28,7 +26,8 @@ case $1 in ;; prometheus-stop) - cat /tmp/prometheus.pid | xargs -r kill + test ! -f /tmp/prometheus.pid || cat /tmp/prometheus.pid | xargs -r kill + rm -f /tmp/prometheus.pid ;;