diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2014-04-23 17:40:51 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-24 17:54:57 +0100 |
commit | 812f69fee5fceef853c42960f3d90491bda8378a (patch) | |
tree | 6e43f64f079b3436c33456ece5a65fc50d73b1c6 /meta/recipes-connectivity/bind/bind | |
parent | 8a92601f8a2030f7875ee1fc6f09fd8242bd7e0d (diff) | |
download | openembedded-core-contrib-812f69fee5fceef853c42960f3d90491bda8378a.tar.gz |
bind: add systemd support
Add systemd support for bind.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/bind/bind')
-rw-r--r-- | meta/recipes-connectivity/bind/bind/generate-rndc-key.sh | 7 | ||||
-rw-r--r-- | meta/recipes-connectivity/bind/bind/named.service | 22 |
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 @@ +#!/bin/sh + +if [ ! -s /etc/bind/rndc.key ]; then + echo -n "Generating /etc/bind/rndc.key:" + /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom + chown 0640 /etc/bind/rndc.key +fi 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 @@ +[Unit] +Description=Berkeley Internet Name Domain (DNS) +Wants=nss-lookup.target +Before=nss-lookup.target +After=network.target + +[Service] +Type=forking +EnvironmentFile=-/etc/sysconfig/named +PIDFile=/run/named/named.pid + +ExecStartPre=@SBINDIR@/generate-rndc-key.sh +ExecStart=@SBINDIR@/named $OPTIONS + +ExecReload=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc reload > /dev/null 2>&1 || @BASE_BINDIR@/kill -HUP $MAINPID' + +ExecStop=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc stop > /dev/null 2>&1 || @BASE_BINDIR@/kill -TERM $MAINPID' + +PrivateTmp=true + +[Install] +WantedBy=multi-user.target |