diff options
author | Roy Li <rongqing.li@windriver.com> | 2012-11-15 02:27:54 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-24 15:12:34 +0000 |
commit | 10baa59425378ad6b4af57cb01a81ea8052fbf4c (patch) | |
tree | 91d34d0278ea4999a1a2d0de80562e2ffac7a0ee /meta/recipes-connectivity/bind | |
parent | 165ed2567057925d7aedc35d1bd5bfd71c008739 (diff) | |
download | poky-10baa59425378ad6b4af57cb01a81ea8052fbf4c.tar.gz |
bind: make "/etc/init.d/bind stop" work
Add some configurations, make rndc command be able to controls
the named daemon.
(From OE-Core rev: 9ad8f7c2bae021269e9a8e35f9fc44a16d23bb6f)
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/bind')
3 files changed, 55 insertions, 5 deletions
diff --git a/meta/recipes-connectivity/bind/bind-9.8.1/conf.patch b/meta/recipes-connectivity/bind/bind-9.8.1/conf.patch index fd5606e84c..6fea70ed15 100644 --- a/meta/recipes-connectivity/bind/bind-9.8.1/conf.patch +++ b/meta/recipes-connectivity/bind/bind-9.8.1/conf.patch | |||
@@ -241,7 +241,7 @@ diff -urN bind-9.3.1.orig/conf/zones.rfc1918 bind-9.3.1/conf/zones.rfc1918 | |||
241 | diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d | 241 | diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d |
242 | --- bind-9.3.1.orig/init.d 1970-01-01 01:00:00.000000000 +0100 | 242 | --- bind-9.3.1.orig/init.d 1970-01-01 01:00:00.000000000 +0100 |
243 | +++ bind-9.3.1/init.d 2005-07-10 23:09:58.000000000 +0200 | 243 | +++ bind-9.3.1/init.d 2005-07-10 23:09:58.000000000 +0200 |
244 | @@ -0,0 +1,63 @@ | 244 | @@ -0,0 +1,70 @@ |
245 | +#!/bin/sh | 245 | +#!/bin/sh |
246 | + | 246 | + |
247 | +PATH=/sbin:/bin:/usr/sbin:/usr/bin | 247 | +PATH=/sbin:/bin:/usr/sbin:/usr/bin |
@@ -259,9 +259,16 @@ diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d | |||
259 | + echo -n "Starting domain name service: named" | 259 | + echo -n "Starting domain name service: named" |
260 | + | 260 | + |
261 | + modprobe capability >/dev/null 2>&1 || true | 261 | + modprobe capability >/dev/null 2>&1 || true |
262 | + if [ ! -f /etc/bind/rndc.key ]; then | ||
263 | + /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom | ||
264 | + chown 0640 /etc/bind/rndc.key | ||
265 | + fi | ||
266 | + if [ -f /var/run/named/named.pid ]; then | ||
267 | + ps `cat /var/run/named/named.pid` > /dev/null && exit 1 | ||
268 | + fi | ||
262 | + | 269 | + |
263 | + # dirs under /var/run can go away on reboots. | 270 | + # dirs under /var/run can go away on reboots. |
264 | + mkdir -p /var/run/bind/run | 271 | + mkdir -p /var/run/named |
265 | + mkdir -p /var/cache/bind | 272 | + mkdir -p /var/cache/bind |
266 | + chmod 775 /var/run/bind/run | 273 | + chmod 775 /var/run/bind/run |
267 | + chown root:bind /var/run/bind/run >/dev/null 2>&1 || true | 274 | + chown root:bind /var/run/bind/run >/dev/null 2>&1 || true |
@@ -271,7 +278,7 @@ diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d | |||
271 | + exit 1 | 278 | + exit 1 |
272 | + fi | 279 | + fi |
273 | + if start-stop-daemon --start --quiet --exec /usr/sbin/named \ | 280 | + if start-stop-daemon --start --quiet --exec /usr/sbin/named \ |
274 | + --pidfile /var/run/bind/run/named.pid -- $OPTIONS; then | 281 | + --pidfile /var/run/named/named.pid -- $OPTIONS; then |
275 | + if [ -x /sbin/resolvconf ] ; then | 282 | + if [ -x /sbin/resolvconf ] ; then |
276 | + echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo | 283 | + echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo |
277 | + fi | 284 | + fi |
@@ -284,7 +291,7 @@ diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d | |||
284 | + if [ -x /sbin/resolvconf ]; then | 291 | + if [ -x /sbin/resolvconf ]; then |
285 | + /sbin/resolvconf -d lo | 292 | + /sbin/resolvconf -d lo |
286 | + fi | 293 | + fi |
287 | + /usr/sbin/rndc stop | 294 | + /usr/sbin/rndc stop >/dev/null 2>&1 |
288 | + echo "." | 295 | + echo "." |
289 | + ;; | 296 | + ;; |
290 | + | 297 | + |
diff --git a/meta/recipes-connectivity/bind/bind-9.8.1/make-etc-initd-bind-stop-work.patch b/meta/recipes-connectivity/bind/bind-9.8.1/make-etc-initd-bind-stop-work.patch new file mode 100644 index 0000000000..146f3e35db --- /dev/null +++ b/meta/recipes-connectivity/bind/bind-9.8.1/make-etc-initd-bind-stop-work.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | bind: make "/etc/init.d/bind stop" work | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Add some configurations, make rndc command be able to controls | ||
6 | the named daemon. | ||
7 | |||
8 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | conf/named.conf | 5 +++++ | ||
11 | conf/rndc.conf | 5 +++++ | ||
12 | 2 files changed, 10 insertions(+), 0 deletions(-) | ||
13 | create mode 100644 conf/rndc.conf | ||
14 | |||
15 | diff --git a/conf/named.conf b/conf/named.conf | ||
16 | index 95829cf..c8899e7 100644 | ||
17 | --- a/conf/named.conf | ||
18 | +++ b/conf/named.conf | ||
19 | @@ -47,3 +47,8 @@ zone "255.in-addr.arpa" { | ||
20 | // root-delegation-only exclude { "DE"; "MUSEUM"; }; | ||
21 | |||
22 | include "/etc/bind/named.conf.local"; | ||
23 | +include "/etc/bind/rndc.key" ; | ||
24 | +controls { | ||
25 | + inet 127.0.0.1 allow { localhost; } | ||
26 | + keys { rndc-key; }; | ||
27 | +}; | ||
28 | diff --git a/conf/rndc.conf b/conf/rndc.conf | ||
29 | new file mode 100644 | ||
30 | index 0000000..a0b481d | ||
31 | --- /dev/null | ||
32 | +++ b/conf/rndc.conf | ||
33 | @@ -0,0 +1,5 @@ | ||
34 | +include "/etc/bind/rndc.key"; | ||
35 | +options { | ||
36 | + default-server localhost; | ||
37 | + default-key rndc-key; | ||
38 | +}; | ||
39 | |||
40 | -- | ||
41 | 1.7.5.4 | ||
42 | |||
diff --git a/meta/recipes-connectivity/bind/bind_9.8.1.bb b/meta/recipes-connectivity/bind/bind_9.8.1.bb index 2efd09de23..23ff0b459e 100644 --- a/meta/recipes-connectivity/bind/bind_9.8.1.bb +++ b/meta/recipes-connectivity/bind/bind_9.8.1.bb | |||
@@ -6,11 +6,12 @@ LICENSE = "ISC & BSD" | |||
6 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=0fbe2a3ab3c68ac3fea3cad13093877c" | 6 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=0fbe2a3ab3c68ac3fea3cad13093877c" |
7 | 7 | ||
8 | DEPENDS = "openssl libcap" | 8 | DEPENDS = "openssl libcap" |
9 | PR = "r3" | 9 | PR = "r4" |
10 | 10 | ||
11 | SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \ | 11 | SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \ |
12 | file://conf.patch \ | 12 | file://conf.patch \ |
13 | file://cross-build-fix.patch \ | 13 | file://cross-build-fix.patch \ |
14 | file://make-etc-initd-bind-stop-work.patch \ | ||
14 | " | 15 | " |
15 | 16 | ||
16 | SRC_URI[md5sum] = "cf31117c5d35af34d4c0702970ad9fb7" | 17 | SRC_URI[md5sum] = "cf31117c5d35af34d4c0702970ad9fb7" |