On Tue, Apr 01, 2008 at 10:52:11AM -0400, Jeff Lightner wrote:
> Huh?
>
> Is this something required for later versions of BIND?
>
> I have BIND 9.2.x on Linux systems in chroot environments but never had
> to mount /proc there. Since /proc isn't a "real" filesystem I was
> under the impression the kernel handled most of what needs to go there.
> Exceptions would be the things one does to force updates in the rare
> areas (e.g. SCSI changes) /proc allows that. What would BIND be doing
> that requires it to directly access /proc?


After quick look into bind and glibc code /proc has to be mounted.
named calls sysconf(3) function and internal glibc implementation
looks like this:

__get_nprocs () {
...
FILE *fp = fopen ("/proc/stat", "rc");
if (fp != NULL) {
..
} else {
fp = fopen ("/proc/cpuinfo", "rc");
if (fp != NULL) {
..
}
..
}

return 1;
}

So if you don't have /proc mounted in chroot glibc is not able to get
number of CPUs and returns 1. When you don't need detect correct
number of CPUs (always use one CPU) then you don't have to mount /proc

Adam

--
Adam Tkac, Red Hat, Inc.