Bug 39175

Summary: bind 9 refuses to chroot when not straced
Product: [Retired] Red Hat Linux Reporter: Matthew Galgoci <mgalgoci>
Component: bindAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: high    
Version: 7.1CC: dr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-07 12:44:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Galgoci 2001-05-05 01:30:55 UTC
Description of Problem:

I have configured bind  9.1.0-10 as shipped with Red Hat 7.1 to run as 
a caching only name server in a chroot environment. I set up a proper
chroot in /var/named  that looks like this:

/var/named
total 24
drwxr-xr-x    2 named    named        4096 May  3 10:59 cache
drwxr-xr-x    2 root     root         4096 May  3 11:04 dev
drwxr-xr-x    2 root     root         4096 May  3 19:31 etc
drwxr-xr-x    2 root     root         4096 May  3 11:19 lib
drwxr-xr-x    2 named    named        4096 May  3 13:02 log
drwxr-xr-x    3 root     root         4096 May  3 11:00 var

./cache:
total 12
-rw-r--r--    1 named    named         195 Mar 13 18:03 localhost.zone
-rw-r--r--    1 named    named        2769 Mar 13 18:03 named.ca
-rw-r--r--    1 named    named         433 Mar 13 18:03 named.local

./dev:
total 0
crw-rw-rw-    1 root     root       1,   3 May  3 11:03 null
crw-rw-rw-    1 root     root       1,   5 May  3 11:04 zero

./etc:
total 32
-rw-r--r--    1 root     root          147 May  3 18:23 hosts
-rw-r--r--    1 root     root        18241 May  3 19:20 ld.so.cache
-rw-r--r--    1 root     root            0 May  3 19:31 ld.so.conf
-rw-r--r--    1 root     root         1267 May  3 18:22 localtime
-rw-r--r--    1 root     root         1827 May  3 13:00 named.conf

./lib:
total 9664
-rwxr-xr-x    1 root     root       471781 May  3 11:19 ld-linux.so.2
-rwxr-xr-x    1 root     root       869430 May  3 11:19 libcrypto.so.1
-rwxr-xr-x    1 root     root      5634864 May  3 11:19 libc.so.6
-rwxr-xr-x    1 root     root        79024 May  3 11:19 libdl.so.2
-rw-r--r--    1 root     root      1427155 May  3 11:19 libdns.so.4
-rw-r--r--    1 root     root       228055 May  3 11:19 libisc.so.3
-rw-r--r--    1 root     root        66108 May  3 11:19 liblwres.so.1
-rwxr-xr-x    1 root     root       445289 May  3 11:19 libnsl.so.1
-rw-r--r--    1 root     root        72666 May  3 11:19 libomapi.so.3
-rwxr-xr-x    1 root     root       528849 May  3 11:19 libpthread.so.0

./log:
total 4
-rw-r--r--    1 root     root          317 May  3 13:03 named.log

./var:
total 4
lrwxrwxrwx    1 root     root            3 May  3 11:00 named -> ../
drwxr-xr-x    2 root     root         4096 May  3 13:03 run

./var/run:
total 4
-rw-r--r--    1 root     root            6 May  3 13:03 named.pid


How Reproducible:

Every time :)


Steps to Reproduce:
1. Set up a proper chroot for named and proper config file
2. start named by hand, like this: /usr/sbin/named -u named -t /var/named
At this point, named will fail to start and exit silently.

3. If you try and strace -f named, it will work just fine:
	strace -f -o /tmp/out /usr/sbin/named -u named -t /var/named 

That is it.

Comment 1 Daniel Roesen 2001-05-07 12:44:36 UTC
are the libs needed in the chroot environment at all? They are loaded before
chroot()ing anyway I think.

Comment 2 Bernhard Rosenkraenzer 2001-07-19 10:42:06 UTC
I can't reproduce this with 9.1.3-3, assuming it was fixed in the base version 
update.


Comment 3 Matthew Galgoci 2001-07-19 15:29:08 UTC
It seems that there are threading issues in the earlier 2.4.x series that have
been fixed in the 2.4.6x series, manifesting themselves in other threaded 
applications like star office and the sun jdk. The issues with staroffice and
the sun jdk seem to have gone away, and I suspect that the same applies to 
named. 

I will verify this and report back.

--Matt