Compare commits

...

2 commits

Author SHA1 Message Date
f
23a0e3bdab don't store crawlers on tmp files
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-09-10 16:06:24 -03:00
f
f5abb9f427 prometheus: start/stop correctly 2022-09-10 15:54:46 -03:00
2 changed files with 4 additions and 4 deletions

View file

@ -18,9 +18,9 @@ RUN addgroup -S -g 777 ssl
RUN addgroup nginx ssl RUN addgroup nginx ssl
# Databases # Databases
RUN wget "${CRAWLERS}" -O /tmp/crawler-user-agents.json
RUN wget ${GEOIP2_DATABASE} -O - | tar -xJf - \ RUN wget ${GEOIP2_DATABASE} -O - | tar -xJf - \
&& rm usr/share/GeoIP/GeoLite2-ASN.mmdb .BUILDINFO .MTREE .PKGINFO && rm usr/share/GeoIP/GeoLite2-ASN.mmdb .BUILDINFO .MTREE .PKGINFO
RUN wget "${CRAWLERS}" -O /usr/share/nginx/crawler-user-agents.json
COPY ./monit.conf /etc/monit.d/nginx.conf COPY ./monit.conf /etc/monit.d/nginx.conf
COPY ./prometheusd.sh /usr/local/bin/prometheusd COPY ./prometheusd.sh /usr/local/bin/prometheusd

View file

@ -5,13 +5,13 @@ pid=/tmp/prometheus.pid
case $1 in case $1 in
start) start)
rm -f ${pid}
daemonize -c /tmp -p ${pid} -l ${pid} -u nobody \ daemonize -c /tmp -p ${pid} -l ${pid} -u nobody \
/usr/local/bin/syslogize \
/usr/bin/nginx-prometheus-exporter -nginx.scrape-uri http://127.0.0.1:8080/stub_status /usr/bin/nginx-prometheus-exporter -nginx.scrape-uri http://127.0.0.1:8080/stub_status
;; ;;
stop) stop)
cat /tmp/prometheus.pid | xargs -r kill test ! -f ${pid} || cat ${pid} | xargs -r kill
rm -f ${pid}
;; ;;
esac esac