commit f18736af53fe947241a2995a2c8dfb26f835559d
Author: Jan RÄ™korajski <[email protected]>
Date:   Wed Apr 10 21:27:30 2013 +0200

    - added systemd service file
    - change how num cpus should be set in sysconfig file

 bind.spec       |  2 ++
 named.service   | 21 +++++++++++++++++++++
 named.sysconfig |  2 +-
 3 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/bind.spec b/bind.spec
index 648ae1c..f165949 100644
--- a/bind.spec
+++ b/bind.spec
@@ -62,6 +62,7 @@ Source8:      %{name}-127.0.0.zone
 Source9:       %{name}-localhost.zone
 Source10:      %{name}-named.conf
 Source11:      %{name}.tmpfiles
+Source12:      named.service
 Patch0:                %{name}-time.patch
 Patch1:                %{name}-link.patch
 Patch2:                %{name}-pmake.patch
@@ -431,6 +432,7 @@ ln -sf %{_var}/lib/named/named.stats        
$RPM_BUILD_ROOT%{_var}/log/named.stats
 
 touch $RPM_BUILD_ROOT%{_var}/lib/named/named.{log,stats}
 
+install %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/named.service
 install %{SOURCE11} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
 
 %if %{with ldap}
diff --git a/named.service b/named.service
new file mode 100644
index 0000000..0138aea
--- /dev/null
+++ b/named.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=Berkeley Internet Name Domain (DNS)
+Wants=nss-lookup.target
+Before=nss-lookup.target
+After=network.target
+
+[Service]
+Type=forking
+PrivateTmp=true
+Environment=CHROOT_TO_DIR=/var/lib/named
+EnvironmentFile=-/etc/sysconfig/named
+ExecStartPre=touch $CHROOT_TO_DIR/named.log
+ExecStartPre=chown named:named $CHROOT_TO_DIR/named.log
+ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf
+ExecStart=/usr/sbin/named -u named -t $CHROOT_TO_DIR -c /etc/named.conf 
$NAMED_OPT
+ExecStop=/bin/sh -c '[ -f /etc/rndc.conf ] && /usr/sbin/rndc stop || /bin/kill 
-TERM $MAINPID'
+ExecReload=/bin/sh -c '[ -f /etc/rndc.conf ] && /usr/sbin/rndc reload || 
/bin/kill -HUP $MAINPID'
+PIDFile=$CHROOT_TO_DIR/named.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/named.sysconfig b/named.sysconfig
index 84e97a7..300b49c 100644
--- a/named.sysconfig
+++ b/named.sysconfig
@@ -3,4 +3,4 @@ SERVICE_RUN_NICE_LEVEL="+2"
 
 # Take advantage of SMP. If not set then named autodetects number of online 
CPUs
 # and runs that number of workers. You can force other value here.
-#NUM_CPUS=1
+#NAMED_OPT="-n 1"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/bind.git/commitdiff/f18736af53fe947241a2995a2c8dfb26f835559d

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to