mount_chroot_conf() { if [ -n "$ROOTDIR" ]; then for all in $ROOTDIR_MOUNT; do # Skip nonexistant files [ -e "$all" ] || continue
# If mount source is a file if ! [ -d "$all" ]; then # mount it only if it is not present in chroot or it is empty if ! [ -e "$ROOTDIR$all" ] || [ `stat -c'%s' "$ROOTDIR$all"` -eq 0 ]; then touch "$ROOTDIR$all" mount --bind "$all" "$ROOTDIR$all" fi else # Mount source is a directory. Mount it only if directory in chroot is # empty. if [ -e "$all" ] && [ `ls -1A $ROOTDIR$all | wc -l` -eq 0 ]; then mount --bind "$all" "$ROOTDIR$all" fi fi done fi }
mount bind で net検索すれば意味がわかると思います ここのサイトの説明は少し古いのかもしれない
Re: chrootを適用した状態のbind関連情報に関して ( No.2 )
????????? 2012/05/18 08:15
????????? 管理者
> stranger 様 度重なるご指摘とフォロー、ありがとうございます。
> Centくん 様 strangerさんが指摘の様に、現時点でのコンテンツは古いものです。 現在はbind-chrootを導入(インストール)した時点で「/etc/sysconfig/named」内の「ROOTDIR」設定値で mount --bindによって自動的にchroot適用前のパスがマウントされるようになり、管理者は意識しなくても良いようになってます。