diff --git a/docker/Dockerfile b/docker/Dockerfile index 19746c4..4da8630 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -34,7 +34,7 @@ ENV PATH="/scrutiny/bin:${PATH}" ADD https://github.com/dshearer/jobber/releases/download/v1.4.4/jobber_1.4.4-1_amd64.deb /tmp/ RUN apt install /tmp/jobber_1.4.4-1_amd64.deb -RUN apt-get update && apt-get install -y smartmontools=7.0-0ubuntu1~ubuntu18.04.1 ca-certificates && update-ca-certificates +RUN apt-get update && apt-get install -y smartmontools=7.0-0ubuntu1~ubuntu18.04.1 ca-certificates curl && update-ca-certificates ADD https://github.com/just-containers/s6-overlay/releases/download/v1.21.8.0/s6-overlay-amd64.tar.gz /tmp/ RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / diff --git a/rootfs/etc/services.d/collector-once/run b/rootfs/etc/services.d/collector-once/run new file mode 100644 index 0000000..46369a1 --- /dev/null +++ b/rootfs/etc/services.d/collector-once/run @@ -0,0 +1,14 @@ +#!/usr/bin/with-contenv bash + +echo "waiting for scrutiny service to start" +s6-svwait -u /var/run/s6/services/scrutiny + +#tell s6 to only run this script once +s6-svc -O /var/run/s6/services/collector-once + +# wait until scrutiny is "Ready" +while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/api/health)" != "200" ]]; do sleep 5; done + + +echo "starting scrutiny collector" +/scrutiny/bin/scrutiny-collector-metrics run