From owner-svn-ports-head@FreeBSD.ORG Thu Apr 30 14:43:06 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D30CF2A; Thu, 30 Apr 2015 14:43:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E182128B; Thu, 30 Apr 2015 14:43:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3UEh6JK063404; Thu, 30 Apr 2015 14:43:06 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3UEh5KE063399; Thu, 30 Apr 2015 14:43:05 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201504301443.t3UEh5KE063399@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 30 Apr 2015 14:43:05 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r385049 - in head/dns: bind910 bind910/files bind99 bind99/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2015 14:43:06 -0000 Author: mat Date: Thu Apr 30 14:43:04 2015 New Revision: 385049 URL: https://svnweb.freebsd.org/changeset/ports/385049 Log: When named.conf was placed somewhere else than %%ETCDIR%%, rndc would stop working. PR: 199384 Submitted by: Curtis Villamizar Sponsored by: Absolight Modified: head/dns/bind910/Makefile head/dns/bind910/files/named.in head/dns/bind99/Makefile head/dns/bind99/files/named.in Modified: head/dns/bind910/Makefile ============================================================================== --- head/dns/bind910/Makefile Thu Apr 30 14:41:20 2015 (r385048) +++ head/dns/bind910/Makefile Thu Apr 30 14:43:04 2015 (r385049) @@ -7,7 +7,7 @@ PORTVERSION= ${ISCVERSION:S/-P/P/} PORTREVISION= 0 .else # dns/bind910 here -PORTREVISION= 2 +PORTREVISION= 3 .endif CATEGORIES= dns net ipv6 MASTER_SITES= ISC/bind9/${ISCVERSION} Modified: head/dns/bind910/files/named.in ============================================================================== --- head/dns/bind910/files/named.in Thu Apr 30 14:41:20 2015 (r385048) +++ head/dns/bind910/files/named.in Thu Apr 30 14:43:04 2015 (r385049) @@ -64,6 +64,10 @@ _named_confdir="${named_chrootdir}${_nam _named_program_root="${named_program%/sbin/named}" _openssl_engines="%%LOCALBASE%%/lib/engines" +# Needed if named.conf and rndc.conf are moved or if rndc.conf is used +rndc_conf=${rndc_conf:-"$_named_confdir/rndc.conf"} +rndc_key=${rndc_key:-"$_named_confdir/rndc.key"} + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. @@ -134,7 +138,7 @@ chroot_autoupdate() "within a jail. Thus a chrooted named cannot " \ "be run from within a jail. Either mount the " \ "devfs with null and random from the host, or " \ - "run named without chrooting it, set" \ + "run named without chrooting it, set " \ "named_chrootdir=\"\" in /etc/rc.conf." fi fi @@ -188,9 +192,9 @@ named_poststart() named_reload() { - # This is a one line function, but ${named_program} is not defined early + # 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 reload + ${_named_program_root}/sbin/rndc ${rndc_flags} reload } find_pidfile() @@ -216,7 +220,7 @@ named_stop() return 1 fi echo 'Stopping named.' - if ${_named_program_root}/sbin/rndc stop 2>/dev/null; then + if ${_named_program_root}/sbin/rndc ${rndc_flags} stop 2>/dev/null; then wait_for_pids ${rc_pid} else echo -n 'rndc failed, trying kill: ' @@ -266,6 +270,16 @@ 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 30 14:41:20 2015 (r385048) +++ head/dns/bind99/Makefile Thu Apr 30 14:43:04 2015 (r385049) @@ -2,7 +2,7 @@ PORTNAME= bind PORTVERSION= ${ISCVERSION:S/-P/P/} -PORTREVISION= 2 +PORTREVISION= 3 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 30 14:41:20 2015 (r385048) +++ head/dns/bind99/files/named.in Thu Apr 30 14:43:04 2015 (r385049) @@ -62,6 +62,10 @@ _named_confdir="${named_chrootdir}${_nam _named_program_root="${named_program%/sbin/named}" _openssl_engines="%%LOCALBASE%%/lib/engines" +# Needed if named.conf and rndc.conf are moved or if rndc.conf is used +rndc_conf=${rndc_conf:-"$_named_confdir/rndc.conf"} +rndc_key=${rndc_key:-"$_named_confdir/rndc.key"} + # If running in a chroot cage, ensure that the appropriate files # exist inside the cage, as well as helper symlinks into the cage # from outside. @@ -186,9 +190,9 @@ named_poststart() named_reload() { - # This is a one line function, but ${named_program} is not defined early + # 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 reload + ${_named_program_root}/sbin/rndc ${rndc_flags} reload } find_pidfile() @@ -214,7 +218,7 @@ named_stop() return 1 fi echo 'Stopping named.' - if ${_named_program_root}/sbin/rndc stop 2>/dev/null; then + if ${_named_program_root}/sbin/rndc ${rndc_flags} stop 2>/dev/null; then wait_for_pids ${rc_pid} else echo -n 'rndc failed, trying kill: ' @@ -264,6 +268,16 @@ 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?