Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jun 2019 07:53:57 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r505404 - in head/dns/coredns: . files
Message-ID:  <201906300753.x5U7rvuM017150@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Sun Jun 30 07:53:57 2019
New Revision: 505404
URL: https://svnweb.freebsd.org/changeset/ports/505404

Log:
  dns/coredns: Add rc script
  
  PR:		238891
  Submitted by:	Žygis Škulteckis <ports@zx23.net>

Added:
  head/dns/coredns/files/
  head/dns/coredns/files/coredns.in   (contents, props changed)
Modified:
  head/dns/coredns/Makefile

Modified: head/dns/coredns/Makefile
==============================================================================
--- head/dns/coredns/Makefile	Sun Jun 30 06:39:03 2019	(r505403)
+++ head/dns/coredns/Makefile	Sun Jun 30 07:53:57 2019	(r505404)
@@ -3,6 +3,7 @@
 PORTNAME=	coredns
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.5.1
+PORTREVISION=	1
 CATEGORIES=	dns
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -88,6 +89,8 @@ GH_TUPLE=	\
 		kubernetes-sigs:yaml:v1.1.0:kubernetes_yaml/vendor/sigs.k8s.io/yaml
 
 GO_PKGNAME=	github.com/${PORTNAME}/${PORTNAME}
+
+USE_RC_SUBR=	${PORTNAME}
 
 PLIST_FILES=	bin/${PORTNAME}
 

Added: head/dns/coredns/files/coredns.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/coredns/files/coredns.in	Sun Jun 30 07:53:57 2019	(r505404)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906300753.x5U7rvuM017150>