summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-dns/bind/files')
-rwxr-xr-xnet-dns/bind/files/generate-rndc-key.sh7
-rw-r--r--net-dns/bind/files/named.conf1
-rw-r--r--net-dns/bind/files/named.service20
3 files changed, 28 insertions, 0 deletions
diff --git a/net-dns/bind/files/generate-rndc-key.sh b/net-dns/bind/files/generate-rndc-key.sh
new file mode 100755
index 000000000000..8314d77cd68c
--- /dev/null
+++ b/net-dns/bind/files/generate-rndc-key.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+if [ ! -s /etc/bind/rndc.key ]; then
+ /usr/sbin/rndc-confgen -a > /dev/null 2>&1 || exit 1
+ chmod 640 /etc/bind/rndc.key
+ chown root.named /etc/bind/rndc.key
+fi
diff --git a/net-dns/bind/files/named.conf b/net-dns/bind/files/named.conf
new file mode 100644
index 000000000000..8f896f6b8aa4
--- /dev/null
+++ b/net-dns/bind/files/named.conf
@@ -0,0 +1 @@
+d /run/named 0755 named root -
diff --git a/net-dns/bind/files/named.service b/net-dns/bind/files/named.service
new file mode 100644
index 000000000000..5caecd28c44a
--- /dev/null
+++ b/net-dns/bind/files/named.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Berkeley Internet Name Domain (DNS)
+After=network.target
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/conf.d/named
+PIDFile=/var/run/named/named.pid
+
+ExecStartPre=/usr/libexec/generate-rndc-key.sh
+ExecStartPre=/usr/sbin/named-checkconf -z /etc/bind/named.conf
+ExecStart=/usr/sbin/named -u named $OPTIONS
+
+ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID'
+ExecStop=/bin/sh -c '/usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID'
+
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target