Bug 2129466

Summary: bind-chroot-9.16.23-1.el9.x86_64 fails to create mount point /var/named/chroot/usr/lib64/named in chroot
Product: Red Hat Enterprise Linux 9 Reporter: gmcnealy <gmcnealy>
Component: bindAssignee: Petr Menšík <pemensik>
Status: CLOSED ERRATA QA Contact: Petr Sklenar <psklenar>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.0CC: psklenar
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: bind-9.16.23-6.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2160473 (view as bug list) Environment:
Last Closed: 2023-05-09 07:40:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2160473    

Description gmcnealy@redhat.com 2022-09-23 21:52:17 UTC
Description of problem:

Running systemctl status named-chroot-setup throws an error

# systemctl status named-chroot-setup.service
○ named-chroot-setup.service - Set-up/destroy chroot environment for named (DNS)
     Loaded: loaded (/usr/lib/systemd/system/named-chroot-setup.service; static)
     Active: inactive (dead) since Thu 2022-09-22 15:27:40 PDT; 13min ago
    Process: 933 ExecStart=/usr/libexec/setup-named-chroot.sh /var/named/chroot on /etc/named-chroot.files (code=exited, status=0/SUCCESS)
    Process: 1040 ExecStop=/usr/libexec/setup-named-chroot.sh /var/named/chroot off /etc/named-chroot.files (code=exited, status=0/SUCCESS)
   Main PID: 933 (code=exited, status=0/SUCCESS)
        CPU: 80ms

Version-Release number of selected component (if applicable):

Fresh install of RHEL 9.0 

bind-license-9.16.23-1.el9.noarch
bind-libs-9.16.23-1.el9.x86_64
bind-utils-9.16.23-1.el9.x86_64
bind-dnssec-doc-9.16.23-1.el9.noarch
bind-dnssec-utils-9.16.23-1.el9.x86_64
bind-9.16.23-1.el9.x86_64
bind-chroot-9.16.23-1.el9.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Install RHEL 9
2. Install Bind packages listed above
3. Run systemctl status named-chroot-setup.service

Actual results:

# systemctl status named-chroot-setup.service
○ named-chroot-setup.service - Set-up/destroy chroot environment for named (DNS)
     Loaded: loaded (/usr/lib/systemd/system/named-chroot-setup.service; static)
     Active: inactive (dead) since Thu 2022-09-22 15:27:40 PDT; 13min ago
    Process: 933 ExecStart=/usr/libexec/setup-named-chroot.sh /var/named/chroot on /etc/named-chroot.files (code=exited, status=0/SUCCESS)
    Process: 1040 ExecStop=/usr/libexec/setup-named-chroot.sh /var/named/chroot off /etc/named-chroot.files (code=exited, status=0/SUCCESS)
   Main PID: 933 (code=exited, status=0/SUCCESS)
        CPU: 80ms

Sep 22 15:27:38 systemd[1]: Starting Set-up/destroy chroot environment for named (DNS)...
Sep 22 15:27:38 setup-named-chroot.sh[979]: ls: cannot access '/var/named/chroot/usr/lib64/named': No such file or directory
Sep 22 15:27:38 setup-named-chroot.sh[981]: mount: /var/named/chroot/usr/lib64/named: mount point does not exist.
Sep 22 15:27:38 systemd[1]: Finished Set-up/destroy chroot environment for named (DNS).
Sep 22 15:27:39 systemd[1]: Stopping Set-up/destroy chroot environment for named (DNS)...
Sep 22 15:27:40 systemd[1]: named-chroot-setup.service: Deactivated successfully.
Sep 22 15:27:40 systemd[1]: Stopped Set-up/destroy chroot environment for named (DNS).

Expected results:

Expected bind-chroot-9.16.23-1.el9.x86_64 to find and mount /var/named/chroot/usr/lib64/named in chroot

Additional info:

The dir is in the list to mount, and it exists in the main root, but the mount point does not exist in the chroot (installed by named-chroot package):

[root@staypuft:~]# egrep "lib64/named" /etc/named-chroot.files
/usr/lib64/named

# ls -ald /usr/lib64/named
drwxr-xr-x. 2 root root 28 Sep 20 13:52 /usr/lib64/named

# ls -al /var/named/chroot/usr/lib64/
total 0
drwxr-xr-x. 3 root root 18 Sep 22 15:45 .
drwxr-xr-x. 4 root root 32 Sep 20 13:52 ..
drwxr-xr-x. 2 root root  6 Nov 26  2021 bind

Since named-chroot creates the dirs in /var/named/chroot, and /var/named/chroot/usr/lib64/named does not exist and therefore cannot be chroot mounted, I believe this is an error in the package (in not creating that mount point).

Comment 2 Petr Menšík 2022-10-03 12:33:55 UTC
Ah yes, there are two directories for /usr/lib64/bind and /usr/lib64/named. But in package files only %dir %{chroot_prefix}/%{_libdir}/bind is mentioned, but %dir %{chroot_prefix}/%{_libdir}/named is not. But because /etc/named-chroot.files lists /usr/lib64/named and that source directory exists, it checks whether target directory is empty. It is missing in this case and it should not.

Just adding %{chroot_prefix}/%{_libdir}/named between the chroot files should help.

Comment 8 errata-xmlrpc 2023-05-09 07:40:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: bind security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2261