summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-dns/coredns/files')
-rw-r--r--net-dns/coredns/files/Corefile.example12
-rw-r--r--net-dns/coredns/files/coredns.confd7
-rw-r--r--net-dns/coredns/files/coredns.initd20
3 files changed, 33 insertions, 6 deletions
diff --git a/net-dns/coredns/files/Corefile.example b/net-dns/coredns/files/Corefile.example
new file mode 100644
index 000000000000..f26e78f2f652
--- /dev/null
+++ b/net-dns/coredns/files/Corefile.example
@@ -0,0 +1,12 @@
+. {
+ loop
+
+ bind 127.0.0.1 ::1
+
+ health 127.0.0.1:8092
+ log
+ errors
+ cache 600
+
+ #forward . tls://9.9.9.9
+}
diff --git a/net-dns/coredns/files/coredns.confd b/net-dns/coredns/files/coredns.confd
index 3e7e56c9a2d0..4686ab97ccd3 100644
--- a/net-dns/coredns/files/coredns.confd
+++ b/net-dns/coredns/files/coredns.confd
@@ -1,4 +1,9 @@
###
# CoreDNS config
#
-command_args=""
+
+COREDNS_CONFIG="/etc/coredns/Corefile"
+COREDNS_EXTRA_ARGS=""
+
+# Uncomment / edit to enable healthchecks
+#COREDNS_HEALTHCHECK_URI="127.0.0.1:8092/health"
diff --git a/net-dns/coredns/files/coredns.initd b/net-dns/coredns/files/coredns.initd
index 1a14214a541d..b47113327f83 100644
--- a/net-dns/coredns/files/coredns.initd
+++ b/net-dns/coredns/files/coredns.initd
@@ -1,15 +1,15 @@
#!/sbin/openrc-run
-# Copyright 2017-2018 Gentoo Authors
+# Copyright 2017-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="CoreDNS service"
-pidfile=${pidfile:-"/run/${SVCNAME}.pid"}
-user=${user:-root}
-group=${group:-root}
+pidfile="${pidfile:-"/run/${SVCNAME}.pid"}"
+user="${user:-root}"
+group="${group:-root}"
supervisor="supervise-daemon"
command="/usr/bin/coredns"
-command_args="${command_args}"
+command_args="-conf ${COREDNS_CONFIG} ${CORENDS_EXTRA_ARGS}"
start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/${SVCNAME}/${SVCNAME}.log \
@@ -18,3 +18,13 @@ start_stop_daemon_args="--user ${user} --group ${group} \
depend() {
after net
}
+
+if [[ -n "${COREDNS_HEALTHCHECK_URI}" ]]; then
+ healthcheck_delay=20
+ healthcheck_timer=30
+
+ healthcheck() {
+ command -v wget || return 0
+ wget -Oq- "${COREDNS_HEALTHCHECK_URI}"
+ }
+fi