public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-dns/bind/files: named.init-r7 named.confd-r3
@ 2009-11-12  8:37 Tomas Chvatal (scarabeus)
  0 siblings, 0 replies; 3+ messages in thread
From: Tomas Chvatal (scarabeus) @ 2009-11-12  8:37 UTC (permalink / raw
  To: gentoo-commits

scarabeus    09/11/12 08:37:17

  Added:                named.init-r7 named.confd-r3
  Log:
  Fix initscript bugs #279568 and #257632.
  (Portage version: 2.2_rc49/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  net-dns/bind/files/named.init-r7

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.init-r7?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.init-r7?rev=1.1&content-type=text/plain

Index: named.init-r7
===================================================================
#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.init-r7,v 1.1 2009/11/12 08:37:16 scarabeus Exp $

opts="start stop reload restart"

depend() {
	need net
	use logger
	after pg_autovacuum postgresql mysql ldap
	provide dns
}

_mount() {
	local from
	local to
	local opts

	if [[ $# -lt 3 ]];
	then
		eerror "_mount(): to few arguments"
		return 1
	fi

	from=$1
	to=$2
	shift 2
	
	opts="${*}"
	shift $#

	if [[ -z $(grep "${to}" /proc/mounts) ]];
	then
		einfo "mounting ${from} to ${to}"
		mount ${from} ${to} ${opts} || return 1
	fi
}

_umount() {
	local dir=$1
	
	if [[ -n $(grep "${dir}" /proc/mounts) ]];
	then
		einfo "umount ${dir}"
		umount ${dir}
	fi
}

checkconfig() {
	if [ ! -f ${CHROOT}/etc/bind/named.conf ] ; then
		eerror "No ${CHROOT}/etc/bind/named.conf file exists!"
	fi
	
	# In case someone have $CPU set in /etc/conf.d/named
	if [ ${CPU} ] ; then
		CPU="-n ${CPU}"
	fi

	# as suggested in bug #107724
	[ -n "${PIDFILE}" ] || PIDFILE=${CHROOT}$(\
		egrep -v \
			"^([[:cntrl:] ]+(#|//|/\*)|(#|//|/\*))" \
			${CHROOT}/etc/bind/named.conf \
				| egrep -o -m1 "pid\-file +\".+\" *;" \
				| cut -d\" -f2
	)

	KEY="${CHROOT}/etc/bind/rndc.key"
}

start() {
	ebegin "Starting ${CHROOT:+chrooted }named"

	if [[ -n ${CHROOT} ]];
	then
		einfo "Mounting chroot dirs"
		_mount /etc/bind ${CHROOT}/etc/bind -o bind
		_mount /var/bind ${CHROOT}/var/bind -o bind
		_mount /var/log/named ${CHROOT}/var/log/named -o bind
	fi

	checkconfig || return 1

	start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
		--nicelevel ${NAMED_NICELEVEL:-0} \
		--exec /usr/sbin/named \
		-- -u named ${CPU} ${OPTIONS} ${CHROOT:+-t} ${CHROOT}
	eend $?
}

stop() {
	local reported=0

	ebegin "Stopping ${CHROOT:+chrooted }named"
	checkconfig || return 2
	if [ -f $KEY ] ; then
		rndc -k $KEY stop &>/dev/null
	else
		start-stop-daemon --stop --quiet --pidfile $PIDFILE \
			--exec /usr/sbin/named -- stop
	fi

	if [[ -n ${CHROOT} ]];
	then
		einfo "Umounting chroot dirs"

		# just to be sure everything gets clean
		while [[ -n $(fuser ${CHROOT} 2>&1) ]]
		do
			if [[ ${reported} -eq 0 ]];
			then
				einfo "Waiting until all named processes are stopped"
				reported=1
			fi
			sleep 1
		done

		_umount ${CHROOT}/etc/bind
		_umount ${CHROOT}/var/log/named
		_umount ${CHROOT}/var/bind
	fi

	eend $?
}

reload() {
	checkconfig || return 3
	if [ ! -f $PIDFILE ] ; then
		/etc/init.d/named start &>/dev/null
		exit
	fi

	if [ -f $KEY ] ; then
		ebegin "Reloading named.conf and zone files"
		rndc -k $KEY reload &>/dev/null
		eend $?
	else /etc/init.d/named restart &>/dev/null
	fi
}



1.1                  net-dns/bind/files/named.confd-r3

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.confd-r3?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.confd-r3?rev=1.1&content-type=text/plain

Index: named.confd-r3
===================================================================
# Set various named options here.
#
OPTIONS=""

# Set this to the number of processors you want bind to use.
# Leave this unchanged if you want bind to automatically detect the number
#CPU="1"

# If you wish to run bind in a chroot, run:
# emerge --config =<bind-version>
# and un-comment the following line.
# You can specify a different chroot directory but MAKE SURE it's empty.
# CHROOT="/chroot/dns"

# Default pid file location
PIDFILE="${CHROOT}/var/run/named/named.pid"

# Scheduling priority: 19 is the lowest and -20 is the highest.
#
NAMED_NICELEVEL="0"






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in net-dns/bind/files: named.init-r7 named.confd-r3
@ 2010-02-25 19:03 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 3+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-02-25 19:03 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/02/25 19:03:31

  Modified:             named.init-r7 named.confd-r3
  Log:
  Bug #306789: Depending on configuration, we might need to tell RNDC where to connect.
  (Portage version: 2.2_rc63/cvs/Linux x86_64)

Revision  Changes    Path
1.2                  net-dns/bind/files/named.init-r7

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.init-r7?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.init-r7?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.init-r7?r1=1.1&r2=1.2

Index: named.init-r7
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.init-r7,v
retrieving revision 1.1
retrieving revision 1.2
diff -p -w -b -B -u -u -r1.1 -r1.2
--- named.init-r7	12 Nov 2009 08:37:16 -0000	1.1
+++ named.init-r7	25 Feb 2010 19:03:31 -0000	1.2
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.init-r7,v 1.1 2009/11/12 08:37:16 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.init-r7,v 1.2 2010/02/25 19:03:31 robbat2 Exp $
 
 opts="start stop reload restart"
 
@@ -95,7 +95,7 @@ stop() {
 	ebegin "Stopping ${CHROOT:+chrooted }named"
 	checkconfig || return 2
 	if [ -f $KEY ] ; then
-		rndc -k $KEY stop &>/dev/null
+		rndc $SERVER -k $KEY stop &>/dev/null
 	else
 		start-stop-daemon --stop --quiet --pidfile $PIDFILE \
 			--exec /usr/sbin/named -- stop
@@ -133,7 +133,7 @@ reload() {
 
 	if [ -f $KEY ] ; then
 		ebegin "Reloading named.conf and zone files"
-		rndc -k $KEY reload &>/dev/null
+		rndc $SERVER -k $KEY reload &>/dev/null
 		eend $?
 	else /etc/init.d/named restart &>/dev/null
 	fi



1.2                  net-dns/bind/files/named.confd-r3

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.confd-r3?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.confd-r3?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-dns/bind/files/named.confd-r3?r1=1.1&r2=1.2

Index: named.confd-r3
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.confd-r3,v
retrieving revision 1.1
retrieving revision 1.2
diff -p -w -b -B -u -u -r1.1 -r1.2
--- named.confd-r3	12 Nov 2009 08:37:16 -0000	1.1
+++ named.confd-r3	25 Feb 2010 19:03:31 -0000	1.2
@@ -6,6 +6,9 @@ OPTIONS=""
 # Leave this unchanged if you want bind to automatically detect the number
 #CPU="1"
 
+# RNDC needs to be told what server we're using sometimes.
+#SERVER="-s 127.0.0.1"
+
 # If you wish to run bind in a chroot, run:
 # emerge --config =<bind-version>
 # and un-comment the following line.






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in net-dns/bind/files: named.init-r7 named.confd-r3
@ 2010-06-09 16:25 Christian Ruppert (idl0r)
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Ruppert (idl0r) @ 2010-06-09 16:25 UTC (permalink / raw
  To: gentoo-commits

idl0r       10/06/09 16:25:06

  Modified:             named.init-r7 named.confd-r3
  Log:
  Define the rndc KEY variable in /etc/conf.d/named, bug 323315.
  (Portage version: 2.2_rc67/cvs/Linux x86_64)

Revision  Changes    Path
1.4                  net-dns/bind/files/named.init-r7

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/files/named.init-r7?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/files/named.init-r7?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/files/named.init-r7?r1=1.3&r2=1.4

Index: named.init-r7
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.init-r7,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- named.init-r7	23 May 2010 20:44:50 -0000	1.3
+++ named.init-r7	9 Jun 2010 16:25:05 -0000	1.4
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.init-r7,v 1.3 2010/05/23 20:44:50 idl0r Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.init-r7,v 1.4 2010/06/09 16:25:05 idl0r Exp $
 
 opts="start stop reload restart"
 
@@ -26,7 +26,7 @@
 	from=$1
 	to=$2
 	shift 2
-	
+
 	opts="${*}"
 	shift $#
 
@@ -39,7 +39,7 @@
 
 _umount() {
 	local dir=$1
-	
+
 	if [[ -n $(grep "${dir}" /proc/mounts) ]];
 	then
 		einfo "umount ${dir}"
@@ -56,7 +56,7 @@
 		[[ ! -d ${CHROOT}/var/run/named || ! -d ${CHROOT}/var/log/named ]] && return 1
 		[[ ! -e ${CHROOT}/etc/localtime ]] && return 1
 		[[ ! -c ${CHROOT}/dev/null || ! -c ${CHROOT}/dev/zero ]] && return 1
-		[[ ! -c ${CHROOT}/dev/random && ! -c ${CHROOT}/dev/urandom ]] && return 1	
+		[[ ! -c ${CHROOT}/dev/random && ! -c ${CHROOT}/dev/urandom ]] && return 1
 	fi
 	return 0
 }
@@ -65,7 +65,7 @@
 	if [ ! -f ${CHROOT}/etc/bind/named.conf ] ; then
 		eerror "No ${CHROOT}/etc/bind/named.conf file exists!"
 	fi
-	
+
 	# In case someone have $CPU set in /etc/conf.d/named
 	if [ ${CPU} ] ; then
 		CPU="-n ${CPU}"
@@ -79,8 +79,6 @@
 				| egrep -o -m1 "pid\-file +\".+\" *;" \
 				| cut -d\" -f2
 	)
-
-	KEY="${CHROOT}/etc/bind/rndc.key"
 }
 
 start() {
@@ -112,8 +110,8 @@
 
 	ebegin "Stopping ${CHROOT:+chrooted }named"
 	checkconfig || return 2
-	if [ -f $KEY ] ; then
-		rndc $SERVER -k $KEY stop &>/dev/null
+	if [ -f $RNDC_KEY ] ; then
+		rndc $SERVER -k $RNDC_KEY stop &>/dev/null
 	else
 		start-stop-daemon --stop --quiet --pidfile $PIDFILE \
 			--exec /usr/sbin/named -- stop
@@ -149,10 +147,11 @@
 		exit
 	fi
 
-	if [ -f $KEY ] ; then
+	if [ -f $RNDC_KEY ] ; then
 		ebegin "Reloading named.conf and zone files"
-		rndc $SERVER -k $KEY reload &>/dev/null
+		rndc $SERVER -k $RNDC_KEY reload &>/dev/null
 		eend $?
-	else /etc/init.d/named restart &>/dev/null
+	else
+		/etc/init.d/named restart &>/dev/null
 	fi
 }



1.4                  net-dns/bind/files/named.confd-r3

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/files/named.confd-r3?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/files/named.confd-r3?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/files/named.confd-r3?r1=1.3&r2=1.4

Index: named.confd-r3
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/files/named.confd-r3,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- named.confd-r3	5 Jun 2010 09:38:09 -0000	1.3
+++ named.confd-r3	9 Jun 2010 16:25:05 -0000	1.4
@@ -8,6 +8,8 @@
 
 # RNDC needs to be told what server we're using sometimes.
 #SERVER="-s 127.0.0.1"
+# rndc key to use
+RNDC_KEY="${CHROOT}/etc/bind/rndc.key"
 
 # If you wish to run bind in a chroot:
 # 1) un-comment the CHROOT= assignment, below. You may use






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-09 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25 19:03 [gentoo-commits] gentoo-x86 commit in net-dns/bind/files: named.init-r7 named.confd-r3 Robin H. Johnson (robbat2)
  -- strict thread matches above, loose matches on Subject: below --
2010-06-09 16:25 Christian Ruppert (idl0r)
2009-11-12  8:37 Tomas Chvatal (scarabeus)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox