Bug 715843

Summary: BIND chroot self mounts /var/named on top of the chroot environment.
Product: Red Hat Enterprise Linux 6 Reporter: Cristian Silva <cristiansilva>
Component: bindAssignee: Adam Tkac <atkac>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1CC: ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-27 10:33:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Cristian Silva 2011-06-23 15:20:26 UTC
Description of problem:
Bind chroot mounts /var/named on top of /var/named/chroot creating 2 chroot directories

Version-Release number of selected component (if applicable):
bind-9.7.3-2.el6_1.P1.1.i686
bind-chroot-9.7.3-2.el6_1.P1.1.i686

How reproducible:
Starting the named service with an empty /var/named/chroot/var/named

Steps to Reproduce:
1. service named start
2. cd /var/named/chroot/var/named/chroot/var/named


[root@dns /]# service named start
Starting named:                                            [  OK  ]
[root@dns /]# cd /var/named/chroot/var/named/chroot/var/named/
[root@dns named]# pwd
/var/named/chroot/var/named/chroot/var/named
[root@dns named]#


Additional info:

BIND wont mount the /var/named directory on /var/named/chroot if there's data on /var/named/chroot/var/named, so copying everything but chroot would be enough to avoid the double chroot

[root@dns /]# cd /var/named
[root@dns named]# cp -rp [!chroot]* /var/named/chroot/var/named/.
[root@dns named]# service named start
Starting named:                                            [  OK  ]
[root@dns named]# ls -la /var/named/chroot/var/named
total 36
drwxr-x--- 5 root  named 4096 Jun 23 09:53 .
drwxr-x--- 6 root  named 4096 Jun 17 10:44 ..
drwxrwx--- 2 named named 4096 Jun 21 03:24 data
drwxrwx--- 2 named named 4096 Jun 23 10:37 dynamic
-rw-r----- 1 root  named 1892 Feb 18  2008 named.ca
-rw-r----- 1 root  named  152 Dec 15  2009 named.empty
-rw-r----- 1 root  named  152 Jun 21  2007 named.localhost
-rw-r----- 1 root  named  168 Dec 15  2009 named.loopback
drwxrwx--- 2 named named 4096 May 27 06:38 slaves
[root@dns named]#

Comment 2 Adam Tkac 2011-06-27 10:33:57 UTC
(In reply to comment #0)
> [root@dns /]# service named start
> Starting named:                                            [  OK  ]
> [root@dns /]# cd /var/named/chroot/var/named/chroot/var/named/
> [root@dns named]# pwd
> /var/named/chroot/var/named/chroot/var/named
> [root@dns named]#

This feature (well, in this case it is more shortage than feature) is inherited from --bind mounts.

When /var/named is mounted into /var/named/chroot/var/named then entire /var/named subtree (which also contains chroot/var/named directory) is mounted into /var/named/chroot/var/named. This is explanation why /var/named/chroot/var/named/chroot/var/named exists. Its existence doesn't cause any issue.

I don't think this is a bug, closing.

Comment 3 Cristian Silva 2011-06-28 13:06:02 UTC
Agreed, is not really a bug and it's a consequence of the mount,  but it doesnt look good either. It's more a cosmetic thing.


cheers,
C.