summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-04-23 17:40:51 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-24 17:55:15 +0100
commitb45533c1c05986b01ea59ea7fb35501436117337 (patch)
tree9bde33e1e6662c9d68cb14ea5edd04ef4135fc70
parent4593e1b0a3bcc3027e801bca0354887884ff9e15 (diff)
downloadpoky-b45533c1c05986b01ea59ea7fb35501436117337.tar.gz
bind: add systemd support
Add systemd support for bind. (From OE-Core rev: 812f69fee5fceef853c42960f3d90491bda8378a) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/bind/bind/generate-rndc-key.sh7
-rw-r--r--meta/recipes-connectivity/bind/bind/named.service22
-rw-r--r--meta/recipes-connectivity/bind/bind_9.9.5.bb17
3 files changed, 45 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh b/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
new file mode 100644
index 0000000000..c2e88bf127
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3if [ ! -s /etc/bind/rndc.key ]; then
4 echo -n "Generating /etc/bind/rndc.key:"
5 /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
6 chown 0640 /etc/bind/rndc.key
7fi
diff --git a/meta/recipes-connectivity/bind/bind/named.service b/meta/recipes-connectivity/bind/bind/named.service
new file mode 100644
index 0000000000..1792e414ab
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/named.service
@@ -0,0 +1,22 @@
1[Unit]
2Description=Berkeley Internet Name Domain (DNS)
3Wants=nss-lookup.target
4Before=nss-lookup.target
5After=network.target
6
7[Service]
8Type=forking
9EnvironmentFile=-/etc/sysconfig/named
10PIDFile=/run/named/named.pid
11
12ExecStartPre=@SBINDIR@/generate-rndc-key.sh
13ExecStart=@SBINDIR@/named $OPTIONS
14
15ExecReload=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc reload > /dev/null 2>&1 || @BASE_BINDIR@/kill -HUP $MAINPID'
16
17ExecStop=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc stop > /dev/null 2>&1 || @BASE_BINDIR@/kill -TERM $MAINPID'
18
19PrivateTmp=true
20
21[Install]
22WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/bind/bind_9.9.5.bb b/meta/recipes-connectivity/bind/bind_9.9.5.bb
index 604deb6236..053c35232d 100644
--- a/meta/recipes-connectivity/bind/bind_9.9.5.bb
+++ b/meta/recipes-connectivity/bind/bind_9.9.5.bb
@@ -13,6 +13,8 @@ SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
13 file://make-etc-initd-bind-stop-work.patch \ 13 file://make-etc-initd-bind-stop-work.patch \
14 file://mips1-not-support-opcode.diff \ 14 file://mips1-not-support-opcode.diff \
15 file://dont-test-on-host.patch \ 15 file://dont-test-on-host.patch \
16 file://generate-rndc-key.sh \
17 file://named.service \
16 " 18 "
17 19
18SRC_URI[md5sum] = "e676c65cad5234617ee22f48e328c24e" 20SRC_URI[md5sum] = "e676c65cad5234617ee22f48e328c24e"
@@ -27,11 +29,13 @@ EXTRA_OECONF = " ${ENABLE_IPV6} --with-randomdev=/dev/random --disable-threads \
27 --with-openssl=${STAGING_LIBDIR}/.. --with-libxml2=${STAGING_LIBDIR}/.. \ 29 --with-openssl=${STAGING_LIBDIR}/.. --with-libxml2=${STAGING_LIBDIR}/.. \
28 --enable-exportlib --with-export-includedir=${includedir} --with-export-libdir=${libdir} \ 30 --enable-exportlib --with-export-includedir=${includedir} --with-export-libdir=${libdir} \
29 " 31 "
30inherit autotools-brokensep update-rc.d 32inherit autotools-brokensep update-rc.d systemd
31 33
32INITSCRIPT_NAME = "bind" 34INITSCRIPT_NAME = "bind"
33INITSCRIPT_PARAMS = "defaults" 35INITSCRIPT_PARAMS = "defaults"
34 36
37SYSTEMD_SERVICE_${PN} = "named.service"
38
35PARALLEL_MAKE = "" 39PARALLEL_MAKE = ""
36 40
37RDEPENDS_${PN} = "python-core" 41RDEPENDS_${PN} = "python-core"
@@ -39,6 +43,7 @@ RDEPENDS_${PN} = "python-core"
39PACKAGES_prepend = " ${PN}-utils " 43PACKAGES_prepend = " ${PN}-utils "
40FILES_${PN}-utils = "${bindir}/host ${bindir}/dig" 44FILES_${PN}-utils = "${bindir}/host ${bindir}/dig"
41FILES_${PN}-dev += "${bindir}/isc-config.h" 45FILES_${PN}-dev += "${bindir}/isc-config.h"
46FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
42 47
43do_install_append() { 48do_install_append() {
44 rm "${D}${bindir}/nslookup" 49 rm "${D}${bindir}/nslookup"
@@ -50,6 +55,16 @@ do_install_append() {
50 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" 55 install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
51 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" 56 install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
52 sed -i -e '1s,#!.*python,#! /usr/bin/env python,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds 57 sed -i -e '1s,#!.*python,#! /usr/bin/env python,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
58
59 # Install systemd related files
60 install -d ${D}${localstatedir}/cache/bind
61 install -d ${D}${sbindir}
62 install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
63 install -d ${D}${systemd_unitdir}/system
64 install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
65 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
66 -e 's,@SBINDIR@,${sbindir},g' \
67 ${D}${systemd_unitdir}/system/named.service
53} 68}
54 69
55CONFFILES_${PN} = " \ 70CONFFILES_${PN} = " \