Mounting proc multiple times

Hi,

I have just upgraded the DHCPD on one of our OpenSUSE 10.2 linux boxes to
the newest 4.1.x release from isc. I want to continue running it chroot so I
have compiled it with the chroot option enabled. However to do this the
dhcpd needs access to the proc filesystem within the chrooted environment.

I have created /var/lib/dhcp/proc to mount it on, and put an entry in the
/etc/fstab, so that it will mount at boot time. The contents of my fstab are
:-

/dev/hda2 / ext2 acl,user_xattr 1 1
/dev/hda3 /other ext2 acl,user_xattr 1 2
/dev/hda1 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

#for DHCPD chroot jail
proc /var/lib/dhcp/proc proc defaults 0 0

However this only mounts proc once on /proc at boot time, which means that
dhcp fails to start.

If I login as root and mount -a then proc is mounted on /var/lib/dhcp/proc
and I can start dhcp successfully.

I’m at a loss as to why this is failing, does anyone know how to solve this,
or how to get the updated dhcpd going without needing to multiple-mount
proc. As I’d like to upgrade our other two DHCP servers as well.

Cheers.

Phill.

Well I don’t know about 10.2 but on 11.1 I see this in /etc/init.d/boot:

mount -n -t proc proc /proc

Which means that it basically ignores the fstab entry and makes a proc mount anyway, provided /proc exists. I believe this is because /proc is so essential and needed right from the beginning, that you can’t let someone stuff up the system startup by deleting that fstab line.

So somewhere in the init scripts you have to do a mount -at proc. Why not in the dhcpd script itself?

I think the Gentoo docs, document installing into a chroot area, from a different version of Linux. They document commands to make /proc available.

IIRC using bind mounts might be the solution, basically having the same /proc available at /proc and /srv/untrusted/chroot/proc