Ubuntu 21.04 changed /etc/service to /etc/runit/runsvdir/svmanaged

pull/100/head
Frank Denis 3 years ago
parent ca2efdc731
commit 22808f0601

@ -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"]

@ -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 >/dev/null 2>/dev/null
}

Loading…
Cancel
Save