From 6bf59b0f119db623566ecab2e794d7942676d9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 28 Mar 2017 19:35:12 +0200 Subject: [PATCH] Make comment how to use different config file --- bind.spec | 5 ++++- named-chroot.service | 5 +++-- named-pkcs11.service | 5 +++-- named-sdb-chroot.service | 5 +++-- named-sdb.service | 5 +++-- named.service | 5 +++-- named.sysconfig | 5 +++++ 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/bind.spec b/bind.spec index 64688c0..0d869f1 100644 --- a/bind.spec +++ b/bind.spec @@ -26,7 +26,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.11.1 -Release: 3%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 4%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: http://www.isc.org/products/BIND/ Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -1135,6 +1135,9 @@ rm -rf ${RPM_BUILD_ROOT} %{python3_sitelib}/isc/__pycache__/*py* %changelog +* Fri Jul 14 2017 Petr Menšík - 32:9.11.1-4.P3 +- Simplify change of default configuration file path + * Thu Jul 13 2017 Petr Menšík - 32:9.11.1-3.P3 - Use mysql_config for SDB variant, build against mariadb-devel diff --git a/named-chroot.service b/named-chroot.service index a015168..5732b1c 100644 --- a/named-chroot.service +++ b/named-chroot.service @@ -12,12 +12,13 @@ After=network.target [Service] Type=forking +Environment=NAMEDCONF=/etc/named.conf EnvironmentFile=-/etc/sysconfig/named Environment=KRB5_KTNAME=/etc/named.keytab PIDFile=/var/named/chroot/run/named/named.pid -ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi' -ExecStart=/usr/sbin/named -u named -t /var/named/chroot $OPTIONS +ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi' +ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} -t /var/named/chroot $OPTIONS ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID' diff --git a/named-pkcs11.service b/named-pkcs11.service index e522ec3..c1a19d1 100644 --- a/named-pkcs11.service +++ b/named-pkcs11.service @@ -8,12 +8,13 @@ After=named-setup-rndc.service [Service] Type=forking +Environment=NAMEDCONF=/etc/named.conf EnvironmentFile=-/etc/sysconfig/named Environment=KRB5_KTNAME=/etc/named.keytab PIDFile=/run/named/named.pid -ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi' -ExecStart=/usr/sbin/named-pkcs11 -u named $OPTIONS +ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi' +ExecStart=/usr/sbin/named-pkcs11 -u named -c ${NAMEDCONF} $OPTIONS ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID' diff --git a/named-sdb-chroot.service b/named-sdb-chroot.service index 0cc0c31..5294f47 100644 --- a/named-sdb-chroot.service +++ b/named-sdb-chroot.service @@ -12,12 +12,13 @@ After=network.target [Service] Type=forking +Environment=NAMEDCONF=/etc/named.conf EnvironmentFile=-/etc/sysconfig/named Environment=KRB5_KTNAME=/etc/named.keytab PIDFile=/var/named/chroot_sdb/run/named/named.pid -ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot_sdb -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi' -ExecStart=/usr/sbin/named-sdb -u named -t /var/named/chroot_sdb $OPTIONS +ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot_sdb -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi' +ExecStart=/usr/sbin/named-sdb -u named -c ${NAMEDCONF} -t /var/named/chroot_sdb $OPTIONS ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID' diff --git a/named-sdb.service b/named-sdb.service index 530156d..b80ec17 100644 --- a/named-sdb.service +++ b/named-sdb.service @@ -8,12 +8,13 @@ After=network.target [Service] Type=forking +Environment=NAMEDCONF=/etc/named.conf EnvironmentFile=-/etc/sysconfig/named Environment=KRB5_KTNAME=/etc/named.keytab PIDFile=/run/named/named.pid -ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi' -ExecStart=/usr/sbin/named-sdb -u named $OPTIONS +ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi' +ExecStart=/usr/sbin/named-sdb -u named -c ${NAMEDCONF} $OPTIONS ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID' diff --git a/named.service b/named.service index bbacf75..6a162ad 100644 --- a/named.service +++ b/named.service @@ -8,12 +8,13 @@ After=network.target [Service] Type=forking +Environment=NAMEDCONF=/etc/named.conf EnvironmentFile=-/etc/sysconfig/named Environment=KRB5_KTNAME=/etc/named.keytab PIDFile=/run/named/named.pid -ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi' -ExecStart=/usr/sbin/named -u named $OPTIONS +ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi' +ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID' diff --git a/named.sysconfig b/named.sysconfig index 2326043..5f6f817 100644 --- a/named.sysconfig +++ b/named.sysconfig @@ -5,6 +5,11 @@ # at startup. Don't add -t here, enable proper # -chroot.service unit file. # +# NAMEDCONF=/etc/named/alternate.conf +# -- Don't use -c to change configuration file. +# Extend systemd named.service instead or use this +# variable. +# # DISABLE_ZONE_CHECKING -- By default, service file calls named-checkzone # utility for every zone to ensure all zones are # valid before named starts. If you set this option