From 0c2a46ee5cde03ff37028a190db9bc68524d5f8c Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 14 Mar 2012 21:23:21 +0000 Subject: main/bind: cleanup and fix named.initd stop --- main/bind/127.zone | 11 ++++++ main/bind/APKBUILD | 38 +++++++++--------- main/bind/bind.127.zone | 11 ------ main/bind/bind.conf | 53 ------------------------- main/bind/bind.confd | 8 ---- main/bind/bind.initd | 90 ------------------------------------------ main/bind/bind.localhost.zone | 11 ------ main/bind/bind.named.ca | 85 ---------------------------------------- main/bind/localhost.zone | 11 ++++++ main/bind/named.ca | 85 ++++++++++++++++++++++++++++++++++++++++ main/bind/named.conf | 53 +++++++++++++++++++++++++ main/bind/named.confd | 8 ++++ main/bind/named.initd | 91 +++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 278 insertions(+), 277 deletions(-) create mode 100644 main/bind/127.zone delete mode 100644 main/bind/bind.127.zone delete mode 100644 main/bind/bind.conf delete mode 100644 main/bind/bind.confd delete mode 100644 main/bind/bind.initd delete mode 100644 main/bind/bind.localhost.zone delete mode 100644 main/bind/bind.named.ca create mode 100644 main/bind/localhost.zone create mode 100644 main/bind/named.ca create mode 100644 main/bind/named.conf create mode 100644 main/bind/named.confd create mode 100644 main/bind/named.initd (limited to 'main/bind') diff --git a/main/bind/127.zone b/main/bind/127.zone new file mode 100644 index 0000000000..2ad28de52c --- /dev/null +++ b/main/bind/127.zone @@ -0,0 +1,11 @@ +$ORIGIN 127.in-addr.arpa. +$TTL 1W +@ 1D IN SOA localhost. root.localhost. ( + 2002081601 ; serial + 3H ; refresh + 15M ; retry + 1W ; expiry + 1D ) ; minimum + + 1D IN NS localhost. +1 1D IN PTR localhost. diff --git a/main/bind/APKBUILD b/main/bind/APKBUILD index c2c81775fd..7cd545fff4 100644 --- a/main/bind/APKBUILD +++ b/main/bind/APKBUILD @@ -5,7 +5,7 @@ pkgver=9.9.0 _ver=${pkgver%_p*} _p=${pkgver#*_p} [ "$_p" != "$pkgver" ] && _ver="${_ver}-P$_p" -pkgrel=0 +pkgrel=1 pkgdesc="BIND - Berkeley Internet Name Domain - Name Server and tools" url="http://www.isc.org" arch="all" @@ -18,12 +18,12 @@ install="$pkgname.pre-install" subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-tools" source="http://ftp.isc.org/isc/bind9/${_ver}/bind-${_ver}.tar.gz bind.so_bsdcompat.patch - $pkgname.initd - $pkgname.confd - $pkgname.conf - $pkgname.127.zone - $pkgname.localhost.zone - $pkgname.named.ca + named.initd + named.confd + named.conf + 127.zone + localhost.zone + named.ca " _builddir="$srcdir/bind-${_ver}" @@ -81,17 +81,17 @@ package() { make DESTDIR="$pkgdir" install || return 1 rm "$pkgdir"/usr/lib/*.la || return 1 - install -Dm755 "$srcdir"/$pkgname.initd \ + install -Dm755 "$srcdir"/named.initd \ "$pkgdir"/etc/init.d/named || return 1 - install -Dm644 "$srcdir"/$pkgname.confd \ + install -Dm644 "$srcdir"/named.confd \ "$pkgdir"/etc/conf.d/named || return 1 - install -Dm644 "$srcdir"/$pkgname.conf \ + install -Dm644 "$srcdir"/named.conf \ "$pkgdir"/etc/bind/named.conf || return 1 - install -Dm644 "$srcdir"/$pkgname.named.ca \ + install -Dm644 "$srcdir"/named.ca \ "$pkgdir"/var/bind/named.ca || return 1 - install -Dm644 "$srcdir"/$pkgname.127.zone \ + install -Dm644 "$srcdir"/127.zone \ "$pkgdir"/var/bind/pri/127.zone || return 1 - install -Dm644 "$srcdir"/$pkgname.localhost.zone \ + install -Dm644 "$srcdir"/localhost.zone \ "$pkgdir"/var/bind/pri/localhost.zone || return 1 cd "$pkgdir"/var/bind ln -s named.ca root.cache || return 1 @@ -114,9 +114,9 @@ tools() { md5sums="9281d0b04f711d28153ba1ab04a54026 bind-9.9.0.tar.gz f270a5b0a28ab6e818840c5c368ddbcc bind.so_bsdcompat.patch -da52267d5d56317d08c0fb170fc14da8 bind.initd -418a367cecfdf8760c92235d3967867e bind.confd -be5fd752bdbd59385f2a559d603098d5 bind.conf -a7455b009b7fccd74ac6f6eaa6902a00 bind.127.zone -c3220168fabfb31a25e8c3a545545e34 bind.localhost.zone -a94e29ac677846f3d4d618c50b7d34f1 bind.named.ca" +1e77ad70d15546ae5e2527892b867580 named.initd +418a367cecfdf8760c92235d3967867e named.confd +be5fd752bdbd59385f2a559d603098d5 named.conf +a7455b009b7fccd74ac6f6eaa6902a00 127.zone +c3220168fabfb31a25e8c3a545545e34 localhost.zone +a94e29ac677846f3d4d618c50b7d34f1 named.ca" diff --git a/main/bind/bind.127.zone b/main/bind/bind.127.zone deleted file mode 100644 index 2ad28de52c..0000000000 --- a/main/bind/bind.127.zone +++ /dev/null @@ -1,11 +0,0 @@ -$ORIGIN 127.in-addr.arpa. -$TTL 1W -@ 1D IN SOA localhost. root.localhost. ( - 2002081601 ; serial - 3H ; refresh - 15M ; retry - 1W ; expiry - 1D ) ; minimum - - 1D IN NS localhost. -1 1D IN PTR localhost. diff --git a/main/bind/bind.conf b/main/bind/bind.conf deleted file mode 100644 index d58c61bde0..0000000000 --- a/main/bind/bind.conf +++ /dev/null @@ -1,53 +0,0 @@ -options { - directory "/var/bind"; - - // uncomment the following lines to turn on DNS forwarding, - // and change the forwarding ip address(es) : - //forward first; - //forwarders { - // 123.123.123.123; - // 123.123.123.123; - //}; - - listen-on-v6 { none; }; - listen-on { 127.0.0.1; }; - - // to allow only specific hosts to use the DNS server: - //allow-query { - // 127.0.0.1; - //}; - - // if you have problems and are behind a firewall: - //query-source address * port 53; - pid-file "/var/run/named/named.pid"; -}; - -// Briefly, a zone which has been declared delegation-only will be effectively -// limited to containing NS RRs for subdomains, but no actual data beyond its -// own apex (for example, its SOA RR and apex NS RRset). This can be used to -// filter out "wildcard" or "synthesized" data from NAT boxes or from -// authoritative name servers whose undelegated (in-zone) data is of no -// interest. -// See http://www.isc.org/products/BIND/delegation-only.html for more info - -//zone "COM" { type delegation-only; }; -//zone "NET" { type delegation-only; }; - -zone "." IN { - type hint; - file "named.ca"; -}; - -zone "localhost" IN { - type master; - file "pri/localhost.zone"; - allow-update { none; }; - notify no; -}; - -zone "127.in-addr.arpa" IN { - type master; - file "pri/127.zone"; - allow-update { none; }; - notify no; -}; diff --git a/main/bind/bind.confd b/main/bind/bind.confd deleted file mode 100644 index a9af5676f7..0000000000 --- a/main/bind/bind.confd +++ /dev/null @@ -1,8 +0,0 @@ -# Set various named options here. -OPTS="" - -# Set this to the number of processors you have. -# CPU="1" - -# Scheduling priority: 19 is the lowest and -20 is the highest. -# NICELEVEL="0" diff --git a/main/bind/bind.initd b/main/bind/bind.initd deleted file mode 100644 index fa9ffb3434..0000000000 --- a/main/bind/bind.initd +++ /dev/null @@ -1,90 +0,0 @@ -#!/sbin/runscript - -extra_commands="checkconfig checkzones" -extra_started_commands="reload" - -depend() { - need net - use logger - provide dns -} - -: ${NAMED_CONF:=/etc/bind/named.conf} - -depend() { - need net - after firewall - use logger - provide dns -} - -_get_pidfile() { - [ -n "${PIDFILE}" ] || PIDFILE=$(\ - /usr/sbin/named-checkconf -p ${NAMED_CONF} | grep 'pid-file' | cut -d\" -f2) - [ -z "${PIDFILE}" ] && PIDFILE=/var/run/named/named.pid -} - -checkconfig() { - ebegin "Checking named configuration" - - if [ ! -f "${NAMED_CONF}" ] ; then - eerror "No ${NAMED_CONF} file exists!" - return 1 - fi - - /usr/sbin/named-checkconf ${NAMED_CONF} || { - eerror "named-checkconf failed! Please fix your config first." - return 1 - } - eend 0 - return 0 -} - -checkzones() { - ebegin "Checking named configuration and zones" - /usr/sbin/named-checkconf -z -j ${NAMED_CONF} - eend $? -} - -start() { - local piddir - ebegin "Starting named" - _get_pidfile - piddir="${PIDFILE%/*}" - if [ ! -d "${piddir}" ]; then - checkpath -q -d -o root:named -m 0770 "${piddir}" || { - eend 1 - return 1 - } - fi - - checkconfig || { eend 1; return 1; } - - # create piddir (usually /var/run/named) if necessary, bug 334535 - _get_pidfile - 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 ${NICELEVEL:-0} \ - --exec /usr/sbin/named \ - -- -u named ${CPU} ${OPTS} - eend $? -} - -stop() { - ebegin "Stopping named" - start-stop-daemon --stop --quiet --pidfile $PIDFILE - eend $? -} - diff --git a/main/bind/bind.localhost.zone b/main/bind/bind.localhost.zone deleted file mode 100644 index 338d7050ca..0000000000 --- a/main/bind/bind.localhost.zone +++ /dev/null @@ -1,11 +0,0 @@ -$TTL 1W -@ IN SOA ns.localhost. root.localhost. ( - 2002081601 ; Serial - 28800 ; Refresh - 14400 ; Retry - 604800 ; Expire - 1 week - 86400 ) ; Minimum -@ IN NS ns -ns IN A 127.0.0.1 - -ns IN AAAA ::1 diff --git a/main/bind/bind.named.ca b/main/bind/bind.named.ca deleted file mode 100644 index 902a7047f9..0000000000 --- a/main/bind/bind.named.ca +++ /dev/null @@ -1,85 +0,0 @@ -; This file holds the information on root name servers needed to -; initialize cache of Internet domain name servers -; (e.g. reference this file in the "cache . " -; configuration file of BIND domain name servers). -; -; This file is made available by InterNIC -; under anonymous FTP as -; file /domain/named.root -; on server FTP.INTERNIC.NET -; -OR- RS.INTERNIC.NET -; -; last update: Feb 04, 2008 -; related version of root zone: 2008020400 -; -; formerly NS.INTERNIC.NET -; -. 3600000 IN NS A.ROOT-SERVERS.NET. -A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 -A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 -; -; formerly NS1.ISI.EDU -; -. 3600000 NS B.ROOT-SERVERS.NET. -B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 -; -; formerly C.PSI.NET -; -. 3600000 NS C.ROOT-SERVERS.NET. -C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 -; -; formerly TERP.UMD.EDU -; -. 3600000 NS D.ROOT-SERVERS.NET. -D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 -; -; formerly NS.NASA.GOV -; -. 3600000 NS E.ROOT-SERVERS.NET. -E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 -; -; formerly NS.ISC.ORG -; -. 3600000 NS F.ROOT-SERVERS.NET. -F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 -F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f -; -; formerly NS.NIC.DDN.MIL -; -. 3600000 NS G.ROOT-SERVERS.NET. -G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 -; -; formerly AOS.ARL.ARMY.MIL -; -. 3600000 NS H.ROOT-SERVERS.NET. -H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 -H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235 -; -; formerly NIC.NORDU.NET -; -. 3600000 NS I.ROOT-SERVERS.NET. -I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 -; -; operated by VeriSign, Inc. -; -. 3600000 NS J.ROOT-SERVERS.NET. -J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 -J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 -; -; operated by RIPE NCC -; -. 3600000 NS K.ROOT-SERVERS.NET. -K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 -K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 -; -; operated by ICANN -; -. 3600000 NS L.ROOT-SERVERS.NET. -L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 -; -; operated by WIDE -; -. 3600000 NS M.ROOT-SERVERS.NET. -M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 -M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 -; End of File diff --git a/main/bind/localhost.zone b/main/bind/localhost.zone new file mode 100644 index 0000000000..338d7050ca --- /dev/null +++ b/main/bind/localhost.zone @@ -0,0 +1,11 @@ +$TTL 1W +@ IN SOA ns.localhost. root.localhost. ( + 2002081601 ; Serial + 28800 ; Refresh + 14400 ; Retry + 604800 ; Expire - 1 week + 86400 ) ; Minimum +@ IN NS ns +ns IN A 127.0.0.1 + +ns IN AAAA ::1 diff --git a/main/bind/named.ca b/main/bind/named.ca new file mode 100644 index 0000000000..902a7047f9 --- /dev/null +++ b/main/bind/named.ca @@ -0,0 +1,85 @@ +; This file holds the information on root name servers needed to +; initialize cache of Internet domain name servers +; (e.g. reference this file in the "cache . " +; configuration file of BIND domain name servers). +; +; This file is made available by InterNIC +; under anonymous FTP as +; file /domain/named.root +; on server FTP.INTERNIC.NET +; -OR- RS.INTERNIC.NET +; +; last update: Feb 04, 2008 +; related version of root zone: 2008020400 +; +; formerly NS.INTERNIC.NET +; +. 3600000 IN NS A.ROOT-SERVERS.NET. +A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 +A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 +; +; formerly NS1.ISI.EDU +; +. 3600000 NS B.ROOT-SERVERS.NET. +B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 +; +; formerly C.PSI.NET +; +. 3600000 NS C.ROOT-SERVERS.NET. +C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 +; +; formerly TERP.UMD.EDU +; +. 3600000 NS D.ROOT-SERVERS.NET. +D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 +; +; formerly NS.NASA.GOV +; +. 3600000 NS E.ROOT-SERVERS.NET. +E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 +; +; formerly NS.ISC.ORG +; +. 3600000 NS F.ROOT-SERVERS.NET. +F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f +; +; formerly NS.NIC.DDN.MIL +; +. 3600000 NS G.ROOT-SERVERS.NET. +G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 +; +; formerly AOS.ARL.ARMY.MIL +; +. 3600000 NS H.ROOT-SERVERS.NET. +H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235 +; +; formerly NIC.NORDU.NET +; +. 3600000 NS I.ROOT-SERVERS.NET. +I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +; +; operated by VeriSign, Inc. +; +. 3600000 NS J.ROOT-SERVERS.NET. +J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 +J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 +; +; operated by RIPE NCC +; +. 3600000 NS K.ROOT-SERVERS.NET. +K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 +; +; operated by ICANN +; +. 3600000 NS L.ROOT-SERVERS.NET. +L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +; +; operated by WIDE +; +. 3600000 NS M.ROOT-SERVERS.NET. +M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 +; End of File diff --git a/main/bind/named.conf b/main/bind/named.conf new file mode 100644 index 0000000000..d58c61bde0 --- /dev/null +++ b/main/bind/named.conf @@ -0,0 +1,53 @@ +options { + directory "/var/bind"; + + // uncomment the following lines to turn on DNS forwarding, + // and change the forwarding ip address(es) : + //forward first; + //forwarders { + // 123.123.123.123; + // 123.123.123.123; + //}; + + listen-on-v6 { none; }; + listen-on { 127.0.0.1; }; + + // to allow only specific hosts to use the DNS server: + //allow-query { + // 127.0.0.1; + //}; + + // if you have problems and are behind a firewall: + //query-source address * port 53; + pid-file "/var/run/named/named.pid"; +}; + +// Briefly, a zone which has been declared delegation-only will be effectively +// limited to containing NS RRs for subdomains, but no actual data beyond its +// own apex (for example, its SOA RR and apex NS RRset). This can be used to +// filter out "wildcard" or "synthesized" data from NAT boxes or from +// authoritative name servers whose undelegated (in-zone) data is of no +// interest. +// See http://www.isc.org/products/BIND/delegation-only.html for more info + +//zone "COM" { type delegation-only; }; +//zone "NET" { type delegation-only; }; + +zone "." IN { + type hint; + file "named.ca"; +}; + +zone "localhost" IN { + type master; + file "pri/localhost.zone"; + allow-update { none; }; + notify no; +}; + +zone "127.in-addr.arpa" IN { + type master; + file "pri/127.zone"; + allow-update { none; }; + notify no; +}; diff --git a/main/bind/named.confd b/main/bind/named.confd new file mode 100644 index 0000000000..a9af5676f7 --- /dev/null +++ b/main/bind/named.confd @@ -0,0 +1,8 @@ +# Set various named options here. +OPTS="" + +# Set this to the number of processors you have. +# CPU="1" + +# Scheduling priority: 19 is the lowest and -20 is the highest. +# NICELEVEL="0" diff --git a/main/bind/named.initd b/main/bind/named.initd new file mode 100644 index 0000000000..c03f35d3a4 --- /dev/null +++ b/main/bind/named.initd @@ -0,0 +1,91 @@ +#!/sbin/runscript + +extra_commands="checkconfig checkzones" +extra_started_commands="reload" + +depend() { + need net + use logger + provide dns +} + +: ${NAMED_CONF:=/etc/bind/named.conf} + +depend() { + need net + after firewall + use logger + provide dns +} + +_get_pidfile() { + [ -n "${PIDFILE}" ] || PIDFILE=$(\ + /usr/sbin/named-checkconf -p ${NAMED_CONF} | grep 'pid-file' | cut -d\" -f2) + [ -z "${PIDFILE}" ] && PIDFILE=/var/run/named/named.pid +} + +checkconfig() { + ebegin "Checking named configuration" + + if [ ! -f "${NAMED_CONF}" ] ; then + eerror "No ${NAMED_CONF} file exists!" + return 1 + fi + + /usr/sbin/named-checkconf ${NAMED_CONF} || { + eerror "named-checkconf failed! Please fix your config first." + return 1 + } + eend 0 + return 0 +} + +checkzones() { + ebegin "Checking named configuration and zones" + /usr/sbin/named-checkconf -z -j ${NAMED_CONF} + eend $? +} + +start() { + local piddir + ebegin "Starting named" + _get_pidfile + piddir="${PIDFILE%/*}" + if [ ! -d "${piddir}" ]; then + checkpath -q -d -o root:named -m 0770 "${piddir}" || { + eend 1 + return 1 + } + fi + + checkconfig || { eend 1; return 1; } + + # create piddir (usually /var/run/named) if necessary, bug 334535 + _get_pidfile + 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 ${NICELEVEL:-0} \ + --exec /usr/sbin/named \ + -- -u named ${CPU} ${OPTS} + eend $? +} + +stop() { + ebegin "Stopping named" + _get_pidfile + start-stop-daemon --stop --quiet --pidfile $PIDFILE + eend $? +} + -- cgit v1.2.3