diff --git a/Dockerfile b/Dockerfile index c9b003eda3975559845203c76987133f3b393c03..413eba1656b0110a7a147f8e479876912e919e5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.git.autistici.org/ai3/docker/chaperone-base:master +FROM registry.git.autistici.org/ai3/docker/s6-base:master COPY elastic.gpg /etc/apt/trusted.gpg.d/ COPY conf /tmp/conf diff --git a/build.sh b/build.sh index 55a7f2858de726d08fbb7cf773ec9fdeff42179b..17c2b10774c9ccabd90a032a82ee1e8c5652376f 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ # Packages that are only used to build the container. These will be # removed once we're done. -BUILD_PACKAGES="curl rsync apt-transport-https" +BUILD_PACKAGES="ca-certificates curl rsync apt-transport-https" # Packages to install. PACKAGES=" diff --git a/conf/chaperone.d/curator-cron.conf b/conf/chaperone.d/curator-cron.conf deleted file mode 100644 index 41872a9b8b8cb7db52eeed5ee4913070931647f6..0000000000000000000000000000000000000000 --- a/conf/chaperone.d/curator-cron.conf +++ /dev/null @@ -1,5 +0,0 @@ -curator-cron.service: { - type: cron, - interval: "19 2 * * *", - command: "/usr/bin/curator-cron", -} diff --git a/conf/chaperone.d/elasticsearch-exporter.conf b/conf/chaperone.d/elasticsearch-exporter.conf deleted file mode 100644 index d8ecae44a8ddfe698477d240b5ea1976eeb60dc1..0000000000000000000000000000000000000000 --- a/conf/chaperone.d/elasticsearch-exporter.conf +++ /dev/null @@ -1,4 +0,0 @@ -exporter.service: { - command: "/bin/sh -c 'exec /usr/sbin/elasticsearch_exporter --es.indices --es.uri http://127.0.0.1:${PORT} --web.listen-address :${EXPORTER_PORT}'", - restart: true, -} diff --git a/conf/chaperone.d/elasticsearch.conf b/conf/chaperone.d/elasticsearch.conf deleted file mode 100644 index e59ff070a1064923b7146bc05568365178b4b64f..0000000000000000000000000000000000000000 --- a/conf/chaperone.d/elasticsearch.conf +++ /dev/null @@ -1,5 +0,0 @@ -elasticsearch.service: { - command: "/bin/sh -c 'exec /usr/share/elasticsearch/bin/elasticsearch -E http.port=${PORT}'", - kill_signal: SIGTERM, - exit_kills: true, -} diff --git a/conf/services.d/curator/run b/conf/services.d/curator/run new file mode 100755 index 0000000000000000000000000000000000000000..01460268cbe9de6fc1e96cb4e77dadada4e3156a --- /dev/null +++ b/conf/services.d/curator/run @@ -0,0 +1,12 @@ +#!/bin/sh + +period=${CURATOR_CRON_PERIOD_SECS:-86400} +offset=$(printf '%d' 0x$(head -c 2 /dev/urandom | xxd -p)) +offset=$(( $offset % $period )) + +sleep $offset +while true; do + /usr/bin/curator-cron + sleep $period +done + diff --git a/conf/services.d/elasticsearch-exporter/run b/conf/services.d/elasticsearch-exporter/run new file mode 100755 index 0000000000000000000000000000000000000000..a2ef40042804ddef964c9bb591459707d37cc9b3 --- /dev/null +++ b/conf/services.d/elasticsearch-exporter/run @@ -0,0 +1,4 @@ +#!/bin/sh + +exec /usr/sbin/elasticsearch_exporter --es.indices --es.uri http://127.0.0.1:${PORT:-8000} --web.listen-address :${EXPORTER_PORT:-8001} + diff --git a/conf/services.d/elasticsearch/finish b/conf/services.d/elasticsearch/finish new file mode 100755 index 0000000000000000000000000000000000000000..b6531b3ca574205c9e78650dbd7c38718683e57c --- /dev/null +++ b/conf/services.d/elasticsearch/finish @@ -0,0 +1,3 @@ +#!/usr/bin/execlineb -S0 + +s6-svscanctl -t /var/run/s6/services diff --git a/conf/services.d/elasticsearch/run b/conf/services.d/elasticsearch/run new file mode 100755 index 0000000000000000000000000000000000000000..18d18b1d3fb7959017986b2cfcc2a9f79473a7bd --- /dev/null +++ b/conf/services.d/elasticsearch/run @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/share/elasticsearch/bin/elasticsearch -E http.port=${PORT:-8000}