summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2010-09-23 17:49:44 +0000
committerChristian Ruppert <idl0r@gentoo.org>2010-09-23 17:49:44 +0000
commit9a1ec5de126968cf99ce35d982addda8a67cdc7e (patch)
treef1006a258ba7585f0faa6534af3564ec0d9a2280 /net-dns
parentRemove Debian -line from admin/nasm to fix building wrt #318155 by Jochen Sch... (diff)
downloadhistorical-9a1ec5de126968cf99ce35d982addda8a67cdc7e.tar.gz
historical-9a1ec5de126968cf99ce35d982addda8a67cdc7e.tar.bz2
historical-9a1ec5de126968cf99ce35d982addda8a67cdc7e.zip
named.confd-r4: New CHROOT_NOMOUNT option to allow one to use the old chroot start behaviour. Add rc_named_use and rc_named_after options to ensure MySQL, PostgreSQL or LDAP will be started first, see bug 295260 and bug 295619.
named.init-r8: Some cleanup. Make the init script POSIX compliant, bug 338353. Add a named-checkconf call to ensure named.conf is valid. Use the new CHROOT_NOMOUNT option to avoid using mount for a chroot named. Some improvements, esp. reload(), bug 335398. Package-Manager: portage-2.2_rc86/cvs/Linux x86_64
Diffstat (limited to 'net-dns')
-rw-r--r--net-dns/bind/ChangeLog12
-rw-r--r--net-dns/bind/Manifest18
-rw-r--r--net-dns/bind/files/named.confd-r446
-rw-r--r--net-dns/bind/files/named.init-r8187
4 files changed, 254 insertions, 9 deletions
diff --git a/net-dns/bind/ChangeLog b/net-dns/bind/ChangeLog
index 3b0f31f71cbf..2bbb3af8bc05 100644
--- a/net-dns/bind/ChangeLog
+++ b/net-dns/bind/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-dns/bind
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.292 2010/09/23 12:11:05 idl0r Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.293 2010/09/23 17:49:44 idl0r Exp $
+
+ 23 Sep 2010; Christian Ruppert <idl0r@gentoo.org> +files/named.confd-r4,
+ +files/named.init-r8:
+ named.confd-r4: New CHROOT_NOMOUNT option to allow one to use the old chroot
+ start behaviour. Add rc_named_use and rc_named_after options to ensure MySQL,
+ PostgreSQL or LDAP will be started first, see bug 295260 and bug 295619.
+ named.init-r8: Some cleanup. Make the init script POSIX compliant, bug
+ 338353. Add a named-checkconf call to ensure named.conf is valid. Use the new
+ CHROOT_NOMOUNT option to avoid using mount for a chroot named. Some
+ improvements, esp. reload(), bug 335398.
23 Sep 2010; Christian Ruppert <idl0r@gentoo.org> bind-9.6.2_p2.ebuild,
bind-9.7.1_p2.ebuild:
diff --git a/net-dns/bind/Manifest b/net-dns/bind/Manifest
index 699bbe9f9f65..686762e45824 100644
--- a/net-dns/bind/Manifest
+++ b/net-dns/bind/Manifest
@@ -14,8 +14,10 @@ AUX named.conf-r3 1317 RMD160 dace9861fb15a7ad415b23f2452fca5eb3ef2604 SHA1 0238
AUX named.conf-r4 5288 RMD160 d5b56d46370b0e54e42aefbe41e1ff290df30439 SHA1 945ee47a99d37c2160829b2fdfd9ffbd3293b333 SHA256 852fc5f2100c94834b59ee64566b7414f0ec12b17751900bb572ab2375c8ca50
AUX named.confd-r2 479 RMD160 0a0452bf9bb6f18d4628ee72abe82a52d484a2cb SHA1 d0b0e2f5d72d43862c5aaff9a226fd8599992323 SHA256 bae05257852ecbc7f66bd30e452162f15b6f6e8c3fc170fb6dfdfa7d22361915
AUX named.confd-r3 719 RMD160 813e82a611c24a0aa3aca0400f499b68727cc8ef SHA1 d4bc0d753e9ec52fa9091b10eca10aee4462b83c SHA256 b37c19dccf3af6e313b09720c12ef7de107a297d2434c78b7101cd67ba0798f6
+AUX named.confd-r4 1293 RMD160 4177cffeef1ff0c8abc1eaba6f5cbeaed5477733 SHA1 89b0c4f4b7dca771bf121e8ce3b00e00bc31ec8c SHA256 2a4b36a7d42b5c8e54b0b4389ac32cba54cfc6187a3fd67c80d90d57434c9dbb
AUX named.init-r5 1798 RMD160 a4cf8a2d19c79c40f7121559a5b0252204ede75b SHA1 0a131aa6b42050c6173c144d26a927f2fe5d3a1b SHA256 71153fce5461d4d85853218371599f5c909c625bacd9894b8a0ff16636773e05
AUX named.init-r7 3622 RMD160 4ed3c76403bf5ddc545b0d681b176fbe5f7f8484 SHA1 dfe2e1a0925b23584581f8dd243bc15a9833bbe0 SHA256 9999609ce9ecb7fcafac50174713e72c2af80137f2c7c06fc5cfee26620a3e7e
+AUX named.init-r8 4287 RMD160 d7c75206ec3c086dbfb5d1315b8902550a63e2dc SHA1 ad864d07bd0e71856875c8c1e8a58f89a54891bc SHA256 e25aa0f83ff472b087fd1c64a890aafc66d1cc8c9dd03b62677ae595cf0afd36
DIST bind-9.4.3-P5.tar.gz 6447497 RMD160 680146e4120aaa89f2899d4205c17fee5e9e4aa9 SHA1 9b7f0bd84be0f91fe1085cedc91c7c14f1e0f97a SHA256 7ca93553d1f488af1b21ab26f0297be5c7b7b5920d29ad9743382bf3623b2939
DIST bind-9.6.2-P2.tar.gz 6543309 RMD160 0706aa4f4f6cd4927d2e8ff72d5fb8a91be94fa9 SHA1 fce8067d3ff03366d5ee305adf941b5c41e41d07 SHA256 233404ea08c4880eb867ee4e1084d96cff748a2bdd8857014203bef511f17e64
DIST bind-9.7.1-P2.tar.gz 7549535 RMD160 ec978498c0e0fa7f709fa3398a573e67557f06a4 SHA1 b24ea0e8a67b841601b803f54070610036931e64 SHA256 37ac37d11e8c16658f3fec49a54747b65c3b5a74b375af638c5944447aebce2c
@@ -26,16 +28,16 @@ DIST dyndns-samples.tbz2 22866 RMD160 27d5b2d0edb8e1ff16b3f980c38d7af33ccf0c7d S
EBUILD bind-9.4.3_p5.ebuild 9208 RMD160 6e7ff13da934a07ba7973e886b0ac03aa7033fb0 SHA1 8320223ec6b82e8988ca23f994457175c25caef0 SHA256 ae0e300cc78a666ef49c7f84432c14f4238b7017e7b579054e54397c28946e3e
EBUILD bind-9.6.2_p2.ebuild 10460 RMD160 0d36479c453bcde968c980bbcae2a5bf9bea29dd SHA1 5bdf5d1a1f20bd8a61927136a83f028a7aedffb6 SHA256 03d6dd0b671df679299f188c9d5c79dd23c6757d926deb88e23c095aef736c5e
EBUILD bind-9.7.1_p2.ebuild 10548 RMD160 59755418ef1dacfc2fa4548f5723b62dd08b2e1d SHA1 18cd6e4b132beaf9e0db1c5db7b394eb0a01f11e SHA256 2ba35b0f43f9e953c5b6f87faa2ecec16091ece156d56978e860b2f76b1f274c
-MISC ChangeLog 48549 RMD160 340de083b96a42557b9a5dd9532103550e9b4abd SHA1 a0998a4d3f2ac7df57e13c27a8a7574feb2921f3 SHA256 e890dba9ceedbe048cf189b0212cb9879ae8785c2796265fbcbfdbb13ce3e95a
+MISC ChangeLog 49149 RMD160 4ee2d71b91d39ee27cd159ee82bb1a46b9b39d2d SHA1 e4a004912830b5e90ca336b8b0396532b30ad6e2 SHA256 f53eed6ebd08e34157afbae28f819baa3605c01b8a689ff9929f23e454ac8ed5
MISC metadata.xml 788 RMD160 bf52f4f66dbf21e131ef2e8f3d4066cc61ba5aee SHA1 30c5619a8831a452fe6881e46f0082fdca6f1664 SHA256 a698cbceada96d79667f8eb109f1ea14ab0fd0590276c8eab1d2abc2f28ab438
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
-iQEcBAEBAgAGBQJMm0PfAAoJEMOx0zmdw4Z1j0sH/RVzE2Tr9kX5gQL8JU6z00PK
-IPwbt3x0NM0RLVlxwkrwyStBF/IDV2b95hp0HwQlrNBnzJGgC4s4LvdCvqpw0tgN
-YPBAFXLc24R1J/yT5I9gm+dS5hdY2/eRgpabahjAUEd29WsUNYvI3TlPMNy9vYjD
-GkMFLT/J4H93fp+hI8x5Uzi3MnDT7q+Tfi+BeOmUS/vml3kYg4o8l0oikqt11zdE
-xYZaNj1j/4dIemYpWzA5xIzWy0FIFqFg6jC1Au38ZNi88mG56a+vKS/oa7cQgQxO
-AxsYwNQIyTR5OcYAHebkhcJUdv+WSzwHpGpwOisJZ/q6jPe/b++9HbM6th+dEbE=
-=8h33
+iQEcBAEBAgAGBQJMm5M9AAoJEMOx0zmdw4Z1MrkIAJRS3zew0M9qGBba8zgQUksK
+UpqOpv7XgIkamIN/RbOk6728hqunHxgCfcmN+zp7tcy+K5gu2rJseaJUlEjCrGbq
+R4n7NsHCMeIlUNgBWYj8JnIUM81cYqo9cMtPI1LtXFpamw0FWp3P0PoVxTAQYUIQ
+o2vLmHbPQKrAun2FBRaFmPyDGVV9Vf+uzkafFFRRgvq1auMg8v645zZYONGRo8r6
+7J5sut+qf9sxmdFGBAhkPxnJ4p7oLQNW10sNvnV+n5LYZtxBgNT397UiydHPgKxI
+qZZgpUHWlOMtUNx6RT4jlEoDqmPE3cf/r2Z54Tm+60L7VlRZZR4nCr1K+J0wIgA=
+=X10o
-----END PGP SIGNATURE-----
diff --git a/net-dns/bind/files/named.confd-r4 b/net-dns/bind/files/named.confd-r4
new file mode 100644
index 000000000000..6fdb00e238d0
--- /dev/null
+++ b/net-dns/bind/files/named.confd-r4
@@ -0,0 +1,46 @@
+# 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:
+# 1) un-comment the CHROOT= assignment, below. You may use
+# a different chroot directory but MAKE SURE it's empty.
+# 2) run: emerge --config =<bind-version>
+#
+#CHROOT="/chroot/dns"
+
+# Uncomment the line below to avoid that the init script mounts the needed paths
+# into the chroot directory.
+# You have to copy all needed config files by hand if you say CHROOT_NOMOUNT="1".
+#CHROOT_NOMOUNT="1"
+
+# 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"
+
+# Default pid file location
+PIDFILE="${CHROOT}/var/run/named/named.pid"
+
+# Scheduling priority: 19 is the lowest and -20 is the highest.
+# Default: 0
+#NAMED_NICELEVEL="0"
+
+# Uncomment rc_named_use/rc_named_after for the database you need.
+# Its necessary to ensure the database backend will be started before named.
+
+# MySQL
+#rc_named_use="mysql"
+#rc_named_after="mysql"
+
+# PostgreSQL
+#rc_named_use="pg_autovacuum postgresql"
+#rc_named_after="pg_autovacuum postgresql"
+
+# LDAP
+#rc_named_use="ldap"
+#rc_named_after="ldap"
diff --git a/net-dns/bind/files/named.init-r8 b/net-dns/bind/files/named.init-r8
new file mode 100644
index 000000000000..b1c5cef4333e
--- /dev/null
+++ b/net-dns/bind/files/named.init-r8
@@ -0,0 +1,187 @@
+#!/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-r8,v 1.1 2010/09/23 17:49:44 idl0r Exp $
+
+opts="start stop reload restart"
+
+depend() {
+ need net
+ use logger
+ provide dns
+}
+
+NAMED_CONF=${CHROOT}/etc/bind/named.conf
+
+_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
+}
+
+check_chroot() {
+ if [ -n "${CHROOT}" ]; then
+ [ ! -d "${CHROOT}" ] && return 1
+ [ ! -d "${CHROOT}/dev" ] || [ ! -d "${CHROOT}/etc" ] || [ ! -d "${CHROOT}/var" ] && return 1
+ [ ! -d "${CHROOT}/var/run" ] || [ ! -d "${CHROOT}/var/log" ] && return 1
+ [ ! -d "${CHROOT}/etc/bind" ] || [ ! -d "${CHROOT}/var/bind" ] && return 1
+ [ ! -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
+ fi
+
+ return 0
+}
+
+checkconfig() {
+ if [ ! -f "${NAMED_CONF}" ] ; then
+ eerror "No ${NAMED_CONF} file exists!"
+ fi
+
+ named-checkconf -z -j ${CHROOT:+-t} ${CHROOT} ${NAMED_CONF/${CHROOT}} 1>/dev/null || {
+ eerror "named-checkconf failed! Please fix your config first."
+ return 1
+ }
+
+ # 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
+ )
+ [ -z "${PIDFILE}" ] && PIDFILE=${CHROOT}/var/run/named/named.pid
+
+ return 0
+}
+
+start() {
+ local piddir
+
+ ebegin "Starting ${CHROOT:+chrooted }named"
+
+ if [ -n "${CHROOT}" ]; then
+ check_chroot || {
+ eend 1
+ eerror "Your chroot dir ${CHROOT} is inconsistent, please run 'emerge --config net-dns/bind' first"
+ return 1
+ }
+
+ if [ "${CHROOT_NOMOUNT:-0}" -eq 0 ]; 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
+ fi
+
+ checkconfig || {
+ eend 1
+ return 1
+ }
+
+ # create piddir (usually /var/run/named) if necessary
+ piddir="${PIDFILE%/*}"
+ if [ ! -d "${piddir}" ]; then
+ checkpath -q -d -o root:named -m 0770 "${piddir}" || {
+ eend 1
+ return 1
+ }
+ fi
+
+ # In case someone have $CPU set in /etc/conf.d/named
+ if [ -n "${CPU}" ] && [ "${CPU}" -gt 0 ]; then
+ CPU="-n ${CPU}"
+ fi
+
+ start-stop-daemon --start --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 [ -n "${RNDC_KEY}" ] && [ -f "${RNDC_KEY}" ]; then
+ rndc $SERVER -k $RNDC_KEY stop 1>/dev/null
+ else
+ # -R 10, bug 335398
+ start-stop-daemon --stop --retry 10 --pidfile $PIDFILE \
+ --exec /usr/sbin/named
+ fi
+
+ if [ -n "${CHROOT}" ] && [ "${CHROOT_NOMOUNT:-0}" -eq 0 ]; then
+ einfo "Umounting chroot dirs"
+
+ # just to be sure everything gets clean
+ while [ -n "$(fuser ${CHROOT} 2>/dev/null)" ]; 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() {
+ local ret
+
+ # checkconf also gives us the pidfile.
+ checkconfig || return 3
+
+ ebegin "Reloading named.conf and zone files"
+ if [ -n "${RNDC_KEY}" ] && [ -f "${RNDC_KEY}" ] ; then
+ rndc $SERVER -k $RNDC_KEY reload 1>/dev/null
+ ret=$?
+ elif [ -n "${PIDFILE}" ]; then
+ start-stop-daemon --pidfile $PIDFILE --signal HUP
+ ret=$?
+ else
+ ewarn "Neither an rndc key has been specified nor a pidfile... this is"
+ ewarn "a fallback mode. Please check your installation!"
+
+ $RC_SERVICE restart
+ ret=$?
+ fi
+
+ eend $ret
+}