Some changes in /etc/rc.d/jail

Alexander Petrovsky askjuise at gmail.com
Tue Jun 22 08:54:16 UTC 2010


Hi!

In the my work process I want use jail-configs like this:

/etc/rc.conf
 jail_enable="YES"
 jjail_v2_enable="YES"

  jail_sysvipc_allow="YES"
 jail_set_hostname_allow="YES"

 jail_list="jail01"

 ail_jail01_name="jail01"
 jail_jail01_hostname="jail01.juise.ru"
 jail_jail01_rootdir="/usr/jail/work/jail01"
 jail_jail01_vnet_enable="YES"
 jail_jail01_mount_enable="YES"
 jail_jail01_devfs_enable="YES"
 jail_jail01_devfs_ruleset="jail"

 jail_jail01_exec_prestart0="mdconfig -a -t vnode -f /usr/jail/images/jail01
-u 1"
 jail_jail01_exec_prestart1="ifconfig epair0 create"
 jail_jail01_exec_prestart2="ifconfig epair0b up"
 jail_jail01_exec_prestart3="ifconfig bridge0 addm epair0b"

 jail_jail01_exec_poststart0="ifconfig epair0a vnet jail01"
 jail_jail01_exec_poststop0="ifconfig epair0b destroy"
 jail_jail01_exec_poststop1="mdconfig -d -u 1"

/etc/fstab.jail01:
 # Device       Mountpoint            FStype Options Dump    Pass#
 /dev/md1      /usr/jail/work/jail01 ufs        rw         0          0
 /usr/jail/base /usr/jail/work/jail01 unionfs  rw         0          0

For use _vnet_enable and _name I use the following patch:
s conf/142972  jail       [jail] [patch] Support JAILv2 and vnet in
rc.d/jail

But the current /etc/rc.d/jail doesn't support execute _exec_prestart FIRST,
_exec_prestart executed after execute mount function, and so I made some
changes in the /etc/rc.d/jail.

In attach:
 full.diff - my patch + BERARD David patch (142972)
 custom.diff - only my patch

-- 
Петровский Александр / Alexander Petrovsky,

ICQ: 350342118
Jabber: juise at jabber.ru
Phone: +7 914 8 820 815
-------------- next part --------------
A non-text attachment was scrubbed...
Name: custom.diff
Type: text/x-patch
Size: 1010 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-jail/attachments/20100622/776717e5/custom-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: full.diff
Type: text/x-patch
Size: 5034 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-jail/attachments/20100622/776717e5/full-0001.bin


More information about the freebsd-jail mailing list