summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2013-07-13 11:43:26 +0000
committerPacho Ramos <pacho@gentoo.org>2013-07-13 11:43:26 +0000
commita6ceacb7ae980fa50736dcc491c37ccf1efff5cd (patch)
treec0db07921232f1b0ad25f5c5c26993750b2b0d13 /net-dns/bind/files
parentinitial import wrt #476288 (diff)
downloadgentoo-2-a6ceacb7ae980fa50736dcc491c37ccf1efff5cd.tar.gz
gentoo-2-a6ceacb7ae980fa50736dcc491c37ccf1efff5cd.tar.bz2
gentoo-2-a6ceacb7ae980fa50736dcc491c37ccf1efff5cd.zip
Install unit file (#466158)
(Portage version: 2.1.12.11/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
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