Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
930 B
2
Indexable
Never
cat /etc/jail.conf
$base = /var/jails;
persist;
vnet;
path = "${base}/${name}";
mount.devfs;
host.domainname = "hal9000.meka.rs";
host.hostname = "${name}.${host.domainname}";
$host_interface = "epair${id}a";
vnet.interface = "epair${id}b";
devfs_ruleset = 8;
allow.raw_sockets;

exec.clean;
exec.consolelog = "/var/log/jails/${host.hostname}";

exec.prestart  = "ifconfig ${host_interface} >/dev/null 2>&1 && ifconfig ${host_interface} destroy >/dev/null 2>&1 || true";
exec.prestart += "ifconfig epair${id} create group $(echo ${name} | cut -b 1-15) up >/dev/null 2>&1 || (ifconfig ${host_interface} destroy && false)";
exec.prestart += "ifconfig jails addm ${host_interface}";

exec.start  = "ifconfig ${vnet.interface} name eth0";
exec.start += "ifconfig eth0 ether ${mac}";
exec.start += "dhclient eth0";
exec.start += "/bin/sh /etc/rc";

exec.stop  = "/bin/sh /etc/rc.shutdown";
exec.stop += "ifconfig eth0 destroy || true";