Do not unconditionally mount devfs to ${jail_devdir}/dev. First check

to see if a prior devfs has been mounted. If no devfs is mounted on
${jail_devdir}/dev then proceed. This will prevent the stack up of
multiple devfs mounts on the same mount point.

Discussed with:	pjd
MFC after:	1 week
This commit is contained in:
Christian S.J. Peron 2005-04-30 00:16:00 +00:00
parent 2af94c5d1d
commit 115005468b

View File

@ -163,15 +163,18 @@ jail_start()
mount -a -F "${jail_fstab}"
fi
if checkyesno jail_devfs; then
info "Mounting devfs on ${jail_devdir}"
devfs_mount_jail "${jail_devdir}" ${jail_ruleset}
# Transitional symlink for old binaries
if [ ! -L "${jail_devdir}/log" ]; then
__pwd="`pwd`"
cd "${jail_devdir}"
ln -sf ../var/run/log log
cd "$__pwd"
# If devfs is already mounted here, skip it.
df -t devfs "${jail_devdir}" >/dev/null
if [ $? -ne 0 ]; then
info "Mounting devfs on ${jail_devdir}"
devfs_mount_jail "${jail_devdir}" ${jail_ruleset}
# Transitional symlink for old binaries
if [ ! -L "${jail_devdir}/log" ]; then
__pwd="`pwd`"
cd "${jail_devdir}"
ln -sf ../var/run/log log
cd "$__pwd"
fi
fi
# XXX - It seems symlinks don't work when there