Move named.local* and named.empty into /usr/share/named
Imagemode might have separate /var partition not properly initialized by package installation. Add creation of compat files into tmpfiles.d definition. Move primary place of those files from /var/named to /usr/shared/named, so we even have some place to symlink them from. Originally it had only copy in sample documentation, which may not be installed. These source file should be read-only from named and not modified anyway. Move them to /usr/share/named as read-only, always present sources. Change compat symlinks in /var/named to point to them instead of /etc. Make the doc files only symlinks to those files too, have them there just once. Keep named.ca config file in /etc/named.ca The rest can stay in _datadir, but named.ca can be potentially updated and as such should remain in /etc and its modification kept. Move primary copy into /etc and keep just legacy symlink inside /var/named. Configuration should stay working if the file were modified. Resolves: RHEL-97443
This commit is contained in:
parent
616fbac3c2
commit
08cf06abdb
42
bind.spec
42
bind.spec
@ -34,7 +34,7 @@
|
||||
%global chroot_prefix %{bind_dir}/chroot
|
||||
%global chroot_create_directories /dev /run/named %{_localstatedir}/{log,named,tmp} \\\
|
||||
%{_sysconfdir}/{crypto-policies/back-ends,pki/dnssec-keys,named} \\\
|
||||
%{_libdir}/bind %{_libdir}/named %{_datadir}/GeoIP /proc/sys/net/ipv4
|
||||
%{_libdir}/bind %{_libdir}/named %{_datadir}/{GeoIP,named} /proc/sys/net/ipv4
|
||||
|
||||
%global selinuxbooleans named_write_master_zones=1
|
||||
## The order of libs is important. See lib/Makefile.in for details
|
||||
@ -80,7 +80,7 @@ License: MPL-2.0 AND ISC AND MIT AND BSD-3-Clause AND BSD-2-Clause
|
||||
# Before rebasing bind, ensure bind-dyndb-ldap is ready to be rebuild and use side-tag with it.
|
||||
# Updating just bind will cause freeipa-dns-server package to be uninstallable.
|
||||
Version: 9.18.33
|
||||
Release: 10%{?dist}
|
||||
Release: 11%{?dist}
|
||||
Epoch: 32
|
||||
Url: https://www.isc.org/downloads/bind/
|
||||
#
|
||||
@ -628,23 +628,33 @@ touch ${RPM_BUILD_ROOT}%{_sysconfdir}/rndc.{key,conf}
|
||||
install -m 644 %{SOURCE27} ${RPM_BUILD_ROOT}%{_sysconfdir}/named.root.key
|
||||
install -m 644 %{SOURCE36} ${RPM_BUILD_ROOT}%{_sysconfdir}/trusted-key.key
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/named
|
||||
install -p -m 644 %{SOURCE17} ${RPM_BUILD_ROOT}%{_sysconfdir}/named.ca
|
||||
ln -sr ${RPM_BUILD_ROOT}%{_sysconfdir}/named.ca \
|
||||
${RPM_BUILD_ROOT}%{_localstatedir}/named/named.ca
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/named
|
||||
install -p -m 644 %{SOURCE18} ${RPM_BUILD_ROOT}%{_datadir}/named/named.localhost
|
||||
install -p -m 644 %{SOURCE19} ${RPM_BUILD_ROOT}%{_datadir}/named/named.loopback
|
||||
install -p -m 644 %{SOURCE20} ${RPM_BUILD_ROOT}%{_datadir}/named/named.empty
|
||||
|
||||
# data files:
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/named
|
||||
install -m 640 %{SOURCE17} ${RPM_BUILD_ROOT}%{_localstatedir}/named/named.ca
|
||||
install -m 640 %{SOURCE18} ${RPM_BUILD_ROOT}%{_localstatedir}/named/named.localhost
|
||||
install -m 640 %{SOURCE19} ${RPM_BUILD_ROOT}%{_localstatedir}/named/named.loopback
|
||||
install -m 640 %{SOURCE20} ${RPM_BUILD_ROOT}%{_localstatedir}/named/named.empty
|
||||
install -m 640 %{SOURCE23} ${RPM_BUILD_ROOT}%{_sysconfdir}/named.rfc1912.zones
|
||||
for FILE in named.{localhost,loopback,empty}
|
||||
do
|
||||
ln -sr "${RPM_BUILD_ROOT}%{_datadir}/named/$FILE" \
|
||||
"${RPM_BUILD_ROOT}%{_localstatedir}/named/$FILE"
|
||||
done
|
||||
install -p -m 640 %{SOURCE23} ${RPM_BUILD_ROOT}%{_sysconfdir}/named.rfc1912.zones
|
||||
|
||||
# sample bind configuration files for %%doc:
|
||||
mkdir -p sample/etc sample/var/named/{data,slaves}
|
||||
install -m 644 %{SOURCE25} sample/etc/named.conf
|
||||
# Copy default configuration to %%doc to make it usable from system-config-bind
|
||||
# Copy default configuration to %%doc
|
||||
install -m 644 %{SOURCE16} named.conf.default
|
||||
install -m 644 %{SOURCE23} sample/etc/named.rfc1912.zones
|
||||
install -m 644 %{SOURCE18} %{SOURCE19} %{SOURCE20} sample/var/named
|
||||
install -m 644 %{SOURCE17} sample/var/named/named.ca
|
||||
ln -s %{_sysconfdir}/named.ca sample/var/named/named.ca
|
||||
for FILE in named.{localhost,loopback,empty}; do
|
||||
ln -s %{_datadir}/named/$FILE sample/var/named/$FILE
|
||||
done
|
||||
for f in my.internal.zone.db slaves/my.slave.internal.zone.db slaves/my.ddns.internal.zone.db my.external.zone.db; do
|
||||
echo '@ in soa localhost. root 1 3H 15M 1W 1D
|
||||
ns localhost.' > sample/var/named/$f;
|
||||
@ -652,10 +662,10 @@ done
|
||||
:;
|
||||
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_tmpfilesdir}
|
||||
install -m 644 %{SOURCE35} ${RPM_BUILD_ROOT}%{_tmpfilesdir}/named.conf
|
||||
install -p -m 644 %{SOURCE35} ${RPM_BUILD_ROOT}%{_tmpfilesdir}/named.conf
|
||||
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/rwtab.d
|
||||
install -m 644 %{SOURCE43} ${RPM_BUILD_ROOT}%{_sysconfdir}/rwtab.d/named
|
||||
install -p -m 644 %{SOURCE43} ${RPM_BUILD_ROOT}%{_sysconfdir}/rwtab.d/named
|
||||
|
||||
%pre
|
||||
if [ "$1" -eq 1 ]; then
|
||||
@ -757,6 +767,7 @@ fi;
|
||||
%dir %{_libdir}/named
|
||||
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/named
|
||||
%config(noreplace) %attr(0644,root,named) %{_sysconfdir}/named.root.key
|
||||
%config(noreplace) %attr(0644,root,named) %{_sysconfdir}/named.ca
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/named
|
||||
%{_tmpfilesdir}/named.conf
|
||||
%{_sysconfdir}/rwtab.d/named
|
||||
@ -798,7 +809,9 @@ fi;
|
||||
%dir %{_localstatedir}/named/dynamic
|
||||
%ghost %{_localstatedir}/log/named.log
|
||||
%defattr(0640,root,named,0750)
|
||||
%{_datadir}/named/
|
||||
%config %verify(not link) %{_localstatedir}/named/named.ca
|
||||
# Moved to %%_datadir/named, keep compat symlinks
|
||||
%config %verify(not link) %{_localstatedir}/named/named.localhost
|
||||
%config %verify(not link) %{_localstatedir}/named/named.loopback
|
||||
%config %verify(not link) %{_localstatedir}/named/named.empty
|
||||
@ -907,6 +920,7 @@ fi;
|
||||
%dir %{chroot_prefix}/%{_libdir}
|
||||
%dir %{chroot_prefix}/%{_libdir}/bind
|
||||
%dir %{chroot_prefix}/%{_datadir}/GeoIP
|
||||
%dir %{chroot_prefix}/%{_datadir}/named
|
||||
%{chroot_prefix}/proc
|
||||
%defattr(0660,root,named,01770)
|
||||
%dir %{chroot_prefix}%{_localstatedir}/named
|
||||
@ -928,6 +942,10 @@ fi;
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri Oct 03 2025 Petr Menšík <pemensik@redhat.com> - 32:9.18.33-11
|
||||
- Move named.* files from /var/named into /usr/share/named
|
||||
- Move named.ca into /etc/named.ca
|
||||
|
||||
* Tue Sep 16 2025 Petr Menšík <pemensik@redhat.com> - 32:9.18.33-10
|
||||
- Fix failures in idna system test (RHEL-66172)
|
||||
|
||||
|
||||
@ -1 +1,10 @@
|
||||
# vim: ft=conf:
|
||||
d /run/named 0755 named named -
|
||||
d /var/named 01770 root named -
|
||||
d /var/named/slaves 0770 named named -
|
||||
d /var/named/data 0770 named named -
|
||||
d /var/named/dynamic 0770 named named -
|
||||
L /var/named/named.ca 0640 named named - ../../../etc/named.ca
|
||||
L /var/named/named.localhost 0640 named named - ../../../usr/share/named/named.localhost
|
||||
L /var/named/named.loopback 0640 named named - ../../../usr/share/named/named.loopback
|
||||
L /var/named/named.empty 0640 named named - ../../../usr/share/named/named.empty
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
# if they are missing or empty in target directory.
|
||||
/etc/localtime
|
||||
/etc/named.root.key
|
||||
/etc/named.ca
|
||||
/etc/named.conf
|
||||
/etc/named.rfc1912.zones
|
||||
/etc/rndc.conf
|
||||
@ -17,6 +18,7 @@
|
||||
/usr/lib64/bind
|
||||
/usr/lib/bind
|
||||
/usr/share/GeoIP
|
||||
/usr/share/named
|
||||
/run/named
|
||||
/proc/sys/net/ipv4/ip_local_port_range
|
||||
# Warning: the order is important
|
||||
|
||||
Loading…
Reference in New Issue
Block a user