aboutsummaryrefslogtreecommitdiff
path: root/dns/coredns
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-06-30 07:53:57 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-06-30 07:53:57 +0000
commit5820dc23c7d23d8e25ae1bcb7e879f20a9eae035 (patch)
treef11ec45eba55374b6a6f24bf3987551622ea943c /dns/coredns
parente17825e891cb599bc3c2ba23eb1780bf477b7780 (diff)
downloadports-5820dc23c7d23d8e25ae1bcb7e879f20a9eae035.tar.gz
ports-5820dc23c7d23d8e25ae1bcb7e879f20a9eae035.zip
Notes
Diffstat (limited to 'dns/coredns')
-rw-r--r--dns/coredns/Makefile3
-rw-r--r--dns/coredns/files/coredns.in45
2 files changed, 48 insertions, 0 deletions
diff --git a/dns/coredns/Makefile b/dns/coredns/Makefile
index 5c837fae71e7..ee11f2fd1b47 100644
--- a/dns/coredns/Makefile
+++ b/dns/coredns/Makefile
@@ -3,6 +3,7 @@
PORTNAME= coredns
DISTVERSIONPREFIX= v
DISTVERSION= 1.5.1
+PORTREVISION= 1
CATEGORIES= dns
MAINTAINER= yuri@FreeBSD.org
@@ -89,6 +90,8 @@ GH_TUPLE= \
GO_PKGNAME= github.com/${PORTNAME}/${PORTNAME}
+USE_RC_SUBR= ${PORTNAME}
+
PLIST_FILES= bin/${PORTNAME}
.include <bsd.port.mk>
diff --git a/dns/coredns/files/coredns.in b/dns/coredns/files/coredns.in
new file mode 100644
index 000000000000..d257821ca9d7
--- /dev/null
+++ b/dns/coredns/files/coredns.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# PROVIDE: coredns
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf.local, /etc/rc.conf or
+# /etc/rc.conf.d/coredns to enable this service:
+#
+# coredns_enable (bool): Set to NO by default.
+# Set it to "YES" to enable coredns.
+# coredns_config (str): Set to $PREFIX/etc/coredns/Corefile by default.
+# Path to configuration file.
+# coredns_cpu_cap (str): Set to "100" by default.
+# CPU cap.
+# coredns_listen_port (str): Set to "53" by default.
+# Port to bind to.
+
+. /etc/rc.subr
+
+name=coredns
+rcvar=coredns_enable
+start_precmd="${name}_precmd"
+
+load_rc_config $name
+
+: ${coredns_enable:="NO"}
+: ${coredns_config:="%%PREFIX%%/etc/coredns/Corefile"}
+: ${coredns_cpu_cap:="100"}
+: ${coredns_listen_port:="53"}
+
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/daemon"
+procname="%%PREFIX%%/bin/${name}"
+coredns_args="-conf ${coredns_config} -cpu ${coredns_cpu_cap} -dns.port ${coredns_listen_port}"
+command_args="-S -m 3 -s "info" -l "daemon" -p ${pidfile} /usr/bin/env ${procname} ${coredns_args}"
+
+coredns_precmd()
+{
+ /usr/bin/install -d -m 0755 \
+ %%PREFIX%%/etc/coredns
+}
+
+run_rc_command "$1"