первое, что на ум пришло и самое простое - это /etc/rc.local
до перезагрузки сервера:
Код: Выделить всё
[22:33 root@blackice /etc]# mount
/dev/twed0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/twed0s1d on /home (ufs, local, soft-updates, acls)
/dev/twed0s1f on /services (ufs, local, soft-updates, acls)
/dev/twed0s1e on /usr (ufs, local, soft-updates)
/dev/twed0s1g on /var (ufs, local, soft-updates)
172.17.2.200:/usr/ports on /usr/ports (nfs)
172.17.2.200:/twed0data/distfiles on /tmp/distfiles (nfs)
/usr/ports on /services/jail/bind/usr/ports (nullfs, read-only)
/tmp/distfiles on /services/jail/bind/tmp/distfiles (nullfs)
/usr/ports on /services/jail/httpd/usr/ports (nullfs, read-only)
/tmp/distfiles on /services/jail/httpd/tmp/distfiles (nullfs)
/usr/ports on /services/jail/mysql/usr/ports (nullfs, read-only)
/tmp/distfiles on /services/jail/mysql/tmp/distfiles (nullfs)
devfs on /services/jail/bind/dev (devfs, local)
procfs on /services/jail/bind/proc (procfs, local)
devfs on /services/jail/mysql/dev (devfs, local)
procfs on /services/jail/mysql/proc (procfs, local)
devfs on /services/jail/httpd/dev (devfs, local)
procfs on /services/jail/httpd/proc (procfs, local)
собственно простейший rc.local
Код: Выделить всё
[22:37 alex@blackice /home/alex]% cat /etc/rc.local
#!/bin/sh
NFSD_SERV=172.17.2.200
NFSD_PORTS_DIR=/usr/ports
NFSD_DIST_DIR=/twed0data/distfiles
LOCAL_PORTS_DIR=/usr/ports
LOCAL_DIST_DIR=/tmp/distfiles
JAILS_PORTS_DIR=/usr/ports
JAILS_DIST_DIR=/tmp/distfiles
JAILS_PREFIX=/services/jail
JAILS_NUM=3
JAIL1=bind
JAIL2=httpd
JAIL3=mysql
I=1
umount -f $LOCAL_PORTS_DIR
umount -f $LOCAL_DIST_DIR
mount ${NFSD_SERV}:$NFSD_PORTS_DIR $LOCAL_PORTS_DIR
mount ${NFSD_SERV}:$NFSD_DIST_DIR $LOCAL_DIST_DIR
while [ $I -le $JAILS_NUM ]
do
eval JAIL=\$JAIL${I}
umount -f $JAILS_PREFIX/$JAIL$JAILS_PORTS_DIR
umount -f $JAILS_PREFIX/$JAIL$JAILS_DIST_DIR
mount_nullfs -o ro ${LOCAL_PORTS_DIR} ${JAILS_PREFIX}/${JAIL}$JAILS_PORTS_DIR
mount_nullfs -o rw ${LOCAL_DIST_DIR} ${JAILS_PREFIX}/${JAIL}$JAILS_DIST_DIR
I=`expr $I + 1`
done
после ребута
Код: Выделить всё
[22:38 alex@blackice /home/alex]% mount
/dev/twed0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/twed0s1d on /home (ufs, local, soft-updates, acls)
/dev/twed0s1f on /services (ufs, local, soft-updates, acls)
/dev/twed0s1e on /usr (ufs, local, soft-updates)
/dev/twed0s1g on /var (ufs, local, soft-updates)
172.17.2.200:/usr/ports on /usr/ports (nfs)
172.17.2.200:/twed0data/distfiles on /tmp/distfiles (nfs)
/usr/ports on /services/jail/bind/usr/ports (nullfs, read-only)
/tmp/distfiles on /services/jail/bind/tmp/distfiles (nullfs)
/usr/ports on /services/jail/httpd/usr/ports (nullfs, read-only)
/tmp/distfiles on /services/jail/httpd/tmp/distfiles (nullfs)
/usr/ports on /services/jail/mysql/usr/ports (nullfs, read-only)
/tmp/distfiles on /services/jail/mysql/tmp/distfiles (nullfs)
devfs on /services/jail/bind/dev (devfs, local)
procfs on /services/jail/bind/proc (procfs, local)
devfs on /services/jail/mysql/dev (devfs, local)
procfs on /services/jail/mysql/proc (procfs, local)
devfs on /services/jail/httpd/dev (devfs, local)
procfs on /services/jail/httpd/proc (procfs, local)
все порты клеток подмонтированы автоматом без всяких fstab )))