Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Apr 2017 10:15:19 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r438434 - in head/dns: bind9-devel bind9-devel/files bind910 bind910/files bind911 bind911/files bind99 bind99/files
Message-ID:  <201704131015.v3DAFJTa064827@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Thu Apr 13 10:15:18 2017
New Revision: 438434
URL: https://svnweb.freebsd.org/changeset/ports/438434

Log:
  Unbreak rndc calls when using non default rndc.key location.
  
  PR:		218335
  Sponsored by:	Absolight

Modified:
  head/dns/bind9-devel/Makefile   (contents, props changed)
  head/dns/bind9-devel/files/named.in
  head/dns/bind910/Makefile   (contents, props changed)
  head/dns/bind910/files/named.in
  head/dns/bind911/Makefile   (contents, props changed)
  head/dns/bind911/files/named.in
  head/dns/bind99/Makefile   (contents, props changed)
  head/dns/bind99/files/named.in

Modified: head/dns/bind9-devel/Makefile
==============================================================================
--- head/dns/bind9-devel/Makefile	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind9-devel/Makefile	Thu Apr 13 10:15:18 2017	(r438434)
@@ -8,7 +8,7 @@ PORTVERSION=	${ISCVERSION:S/-P/P/:S/b/.b
 PORTREVISION=	0
 .else
 # dns/bind9xx here
-PORTREVISION=	0
+PORTREVISION=	1
 .endif
 CATEGORIES=	dns net ipv6
 MASTER_SITES=	LOCAL/mat/bind

Modified: head/dns/bind9-devel/files/named.in
==============================================================================
--- head/dns/bind9-devel/files/named.in	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind9-devel/files/named.in	Thu Apr 13 10:15:18 2017	(r438434)
@@ -194,7 +194,7 @@ named_reload()
 {
 	# This is a one line function, but ${named_program} is not defined early
 	# enough to be there when the reload_cmd variable is defined up there.
-	${_named_program_root}/sbin/rndc ${rndc_flags} reload
+	rndc reload
 }
 
 find_pidfile()
@@ -220,7 +220,7 @@ named_stop()
 		return 1
 	fi
 	echo 'Stopping named.'
-	if ${_named_program_root}/sbin/rndc ${rndc_flags} stop 2>/dev/null; then
+	if rndc stop; then
 		wait_for_pids ${rc_pid}
 	else
 		echo -n 'rndc failed, trying kill: '
@@ -255,6 +255,21 @@ create_file()
 	install -o root -g wheel -m 0644 /dev/null $1
 }
 
+rndc()
+{
+	if [ -z "${rndc_flags}" ]; then
+		if [ -s "${rndc_conf}" ] ; then
+			rndc_flags="-c ${rndc_conf}"
+		elif [ -s "${rndc_key}" ] ; then
+			rndc_flags="-k ${rndc_key}"
+		else
+			rndc_flags=""
+		fi
+	fi
+
+	${_named_program_root}/sbin/rndc ${rndc_flags} "$@"
+}
+
 named_prestart()
 {
 	find_pidfile
@@ -270,16 +285,6 @@ named_prestart()
 
 	command_args="-u ${named_uid:=root} -c ${named_conf} ${command_args}"
 
-	if [ -z "${rndc_flags}" ]; then
-		if [ -s ${rndc_conf} ] ; then
-			rndc_flags="-c ${rndc_conf}"
-		elif [ -s ${rndc_key} ] ; then
-			rndc_flags="-k ${rndc_key}"
-		else
-			rndc_flags=""
-		fi
-	fi
-
 %%NATIVE_PKCS11%%	if [ -z "${named_pkcs11_engine}"]; then
 %%NATIVE_PKCS11%%		err 3 "named_pkcs11_engine has to be set to the PKCS#11 engine's library you want to use"
 %%NATIVE_PKCS11%%	elif [ ! -f ${named_pkcs11_engine} ]; then

Modified: head/dns/bind910/Makefile
==============================================================================
--- head/dns/bind910/Makefile	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind910/Makefile	Thu Apr 13 10:15:18 2017	(r438434)
@@ -3,7 +3,7 @@
 
 PORTNAME=	bind
 PORTVERSION=	${ISCVERSION:S/-P/P/:S/b/.b/:S/a/.a/:S/rc/.rc/}
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	dns net ipv6
 MASTER_SITES=	ISC/bind9/${ISCVERSION}
 PKGNAMESUFFIX=	910

Modified: head/dns/bind910/files/named.in
==============================================================================
--- head/dns/bind910/files/named.in	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind910/files/named.in	Thu Apr 13 10:15:18 2017	(r438434)
@@ -194,7 +194,7 @@ named_reload()
 {
 	# This is a one line function, but ${named_program} is not defined early
 	# enough to be there when the reload_cmd variable is defined up there.
-	${_named_program_root}/sbin/rndc ${rndc_flags} reload
+	rndc reload
 }
 
 find_pidfile()
@@ -220,7 +220,7 @@ named_stop()
 		return 1
 	fi
 	echo 'Stopping named.'
-	if ${_named_program_root}/sbin/rndc ${rndc_flags} stop 2>/dev/null; then
+	if rndc stop; then
 		wait_for_pids ${rc_pid}
 	else
 		echo -n 'rndc failed, trying kill: '
@@ -255,6 +255,21 @@ create_file()
 	install -o root -g wheel -m 0644 /dev/null $1
 }
 
+rndc()
+{
+	if [ -z "${rndc_flags}" ]; then
+		if [ -s "${rndc_conf}" ] ; then
+			rndc_flags="-c ${rndc_conf}"
+		elif [ -s "${rndc_key}" ] ; then
+			rndc_flags="-k ${rndc_key}"
+		else
+			rndc_flags=""
+		fi
+	fi
+
+	${_named_program_root}/sbin/rndc ${rndc_flags} "$@"
+}
+
 named_prestart()
 {
 	find_pidfile
@@ -270,16 +285,6 @@ named_prestart()
 
 	command_args="-u ${named_uid:=root} -c ${named_conf} ${command_args}"
 
-	if [ -z "${rndc_flags}" ]; then
-		if [ -s ${rndc_conf} ] ; then
-			rndc_flags="-c ${rndc_conf}"
-		elif [ -s ${rndc_key} ] ; then
-			rndc_flags="-k ${rndc_key}"
-		else
-			rndc_flags=""
-		fi
-	fi
-
 %%NATIVE_PKCS11%%	if [ -z "${named_pkcs11_engine}"]; then
 %%NATIVE_PKCS11%%		err 3 "named_pkcs11_engine has to be set to the PKCS#11 engine's library you want to use"
 %%NATIVE_PKCS11%%	elif [ ! -f ${named_pkcs11_engine} ]; then

Modified: head/dns/bind911/Makefile
==============================================================================
--- head/dns/bind911/Makefile	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind911/Makefile	Thu Apr 13 10:15:18 2017	(r438434)
@@ -8,7 +8,7 @@ PORTVERSION=	${ISCVERSION:S/-P/P/:S/b/.b
 PORTREVISION=	0
 .else
 # dns/bind9xx here
-PORTREVISION=	0
+PORTREVISION=	1
 .endif
 CATEGORIES=	dns net ipv6
 MASTER_SITES=	ISC/bind9/${ISCVERSION}

Modified: head/dns/bind911/files/named.in
==============================================================================
--- head/dns/bind911/files/named.in	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind911/files/named.in	Thu Apr 13 10:15:18 2017	(r438434)
@@ -194,7 +194,7 @@ named_reload()
 {
 	# This is a one line function, but ${named_program} is not defined early
 	# enough to be there when the reload_cmd variable is defined up there.
-	${_named_program_root}/sbin/rndc ${rndc_flags} reload
+	rndc reload
 }
 
 find_pidfile()
@@ -220,7 +220,7 @@ named_stop()
 		return 1
 	fi
 	echo 'Stopping named.'
-	if ${_named_program_root}/sbin/rndc ${rndc_flags} stop 2>/dev/null; then
+	if rndc stop; then
 		wait_for_pids ${rc_pid}
 	else
 		echo -n 'rndc failed, trying kill: '
@@ -255,6 +255,21 @@ create_file()
 	install -o root -g wheel -m 0644 /dev/null $1
 }
 
+rndc()
+{
+	if [ -z "${rndc_flags}" ]; then
+		if [ -s "${rndc_conf}" ] ; then
+			rndc_flags="-c ${rndc_conf}"
+		elif [ -s "${rndc_key}" ] ; then
+			rndc_flags="-k ${rndc_key}"
+		else
+			rndc_flags=""
+		fi
+	fi
+
+	${_named_program_root}/sbin/rndc ${rndc_flags} "$@"
+}
+
 named_prestart()
 {
 	find_pidfile
@@ -270,16 +285,6 @@ named_prestart()
 
 	command_args="-u ${named_uid:=root} -c ${named_conf} ${command_args}"
 
-	if [ -z "${rndc_flags}" ]; then
-		if [ -s ${rndc_conf} ] ; then
-			rndc_flags="-c ${rndc_conf}"
-		elif [ -s ${rndc_key} ] ; then
-			rndc_flags="-k ${rndc_key}"
-		else
-			rndc_flags=""
-		fi
-	fi
-
 %%NATIVE_PKCS11%%	if [ -z "${named_pkcs11_engine}"]; then
 %%NATIVE_PKCS11%%		err 3 "named_pkcs11_engine has to be set to the PKCS#11 engine's library you want to use"
 %%NATIVE_PKCS11%%	elif [ ! -f ${named_pkcs11_engine} ]; then

Modified: head/dns/bind99/Makefile
==============================================================================
--- head/dns/bind99/Makefile	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind99/Makefile	Thu Apr 13 10:15:18 2017	(r438434)
@@ -3,7 +3,7 @@
 
 PORTNAME=	bind
 PORTVERSION=	${ISCVERSION:S/-P/P/:S/b/.b/:S/a/.a/:S/rc/.rc/}
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	dns net ipv6
 MASTER_SITES=	ISC/bind9/${ISCVERSION}
 PKGNAMESUFFIX=	99

Modified: head/dns/bind99/files/named.in
==============================================================================
--- head/dns/bind99/files/named.in	Thu Apr 13 10:15:14 2017	(r438433)
+++ head/dns/bind99/files/named.in	Thu Apr 13 10:15:18 2017	(r438434)
@@ -192,7 +192,7 @@ named_reload()
 {
 	# This is a one line function, but ${named_program} is not defined early
 	# enough to be there when the reload_cmd variable is defined up there.
-	${_named_program_root}/sbin/rndc ${rndc_flags} reload
+	rndc reload
 }
 
 find_pidfile()
@@ -218,7 +218,7 @@ named_stop()
 		return 1
 	fi
 	echo 'Stopping named.'
-	if ${_named_program_root}/sbin/rndc ${rndc_flags} stop 2>/dev/null; then
+	if rndc stop; then
 		wait_for_pids ${rc_pid}
 	else
 		echo -n 'rndc failed, trying kill: '
@@ -253,6 +253,21 @@ create_file()
 	install -o root -g wheel -m 0644 /dev/null $1
 }
 
+rndc()
+{
+	if [ -z "${rndc_flags}" ]; then
+		if [ -s "${rndc_conf}" ] ; then
+			rndc_flags="-c ${rndc_conf}"
+		elif [ -s "${rndc_key}" ] ; then
+			rndc_flags="-k ${rndc_key}"
+		else
+			rndc_flags=""
+		fi
+	fi
+
+	${_named_program_root}/sbin/rndc ${rndc_flags} "$@"
+}
+
 named_prestart()
 {
 	find_pidfile
@@ -268,16 +283,6 @@ named_prestart()
 
 	command_args="-u ${named_uid:=root} -c ${named_conf} ${command_args}"
 
-	if [ -z "${rndc_flags}" ]; then
-		if [ -s ${rndc_conf} ] ; then
-			rndc_flags="-c ${rndc_conf}"
-		elif [ -s ${rndc_key} ] ; then
-			rndc_flags="-k ${rndc_key}"
-		else
-			rndc_flags=""
-		fi
-	fi
-
 	local line nsip firstns
 
 	# Is the user using a sandbox?



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