summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/bind/bind
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/bind/bind')
-rw-r--r--meta/recipes-connectivity/bind/bind/generate-rndc-key.sh7
-rw-r--r--meta/recipes-connectivity/bind/bind/named.service22
2 files changed, 29 insertions, 0 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