From 22808f0601e10b72cad8e1417c1c4321979b4692 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 22 Apr 2021 20:04:59 +0200 Subject: [PATCH] Ubuntu 21.04 changed /etc/service to /etc/runit/runsvdir/svmanaged --- Dockerfile | 17 +++++++++-------- entrypoint.sh | 6 ++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 643a270..a06a5bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM ubuntu:20.10 +FROM ubuntu:21.04 LABEL maintainer="Frank Denis" SHELL ["/bin/sh", "-x", "-c"] -ENV SERIAL 2 +ENV SERIAL 3 ENV CFLAGS=-Ofast ENV BUILD_DEPS curl make build-essential git libevent-dev libexpat1-dev autoconf file libssl-dev byacc @@ -57,20 +57,21 @@ RUN groupadd _encrypted-dns && \ chown _encrypted-dns:_encrypted-dns /opt/dnscrypt-wrapper/etc/keys RUN mkdir -p \ - /etc/service/unbound \ - /etc/service/watchdog + /var/svc/unbound \ + /var/svc/encrypted-dns \ + /var/svc/watchdog COPY encrypted-dns.toml.in /opt/encrypted-dns/etc/ COPY undelegated.txt /opt/encrypted-dns/etc/ COPY entrypoint.sh / -COPY unbound.sh /etc/service/unbound/run -COPY unbound-check.sh /etc/service/unbound/check +COPY unbound.sh /var/svc/unbound/run +COPY unbound-check.sh /var/svc/unbound/check -COPY encrypted-dns.sh /etc/service/encrypted-dns/run +COPY encrypted-dns.sh /var/svc/encrypted-dns/run -COPY watchdog.sh /etc/service/watchdog/run +COPY watchdog.sh /var/svc/watchdog/run VOLUME ["/opt/encrypted-dns/etc/keys"] diff --git a/entrypoint.sh b/entrypoint.sh index 4d6001a..a2c39d2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,6 +13,7 @@ LISTS_DIR="/opt/encrypted-dns/etc/lists" CONF_DIR="/opt/encrypted-dns/etc" CONFIG_FILE="${CONF_DIR}/encrypted-dns.toml" CONFIG_FILE_TEMPLATE="${CONF_DIR}/encrypted-dns.toml.in" +SERVICES_DIR="/etc/runit/runsvdir/svmanaged" init() { if [ "$(is_initialized)" = yes ]; then @@ -172,6 +173,11 @@ start() { /opt/encrypted-dns/sbin/encrypted-dns \ --config "$CONFIG_FILE" --dry-run | tee "${KEYS_DIR}/provider-info.txt" + + find /var/svc -mindepth 1 -maxdepth 1 -type d | while read -r service; do + ln -s "$service" "${SERVICES_DIR}/" + done + exec /etc/runit/2 /dev/null 2>/dev/null }