[Bug 196574] Bug in parsing jail.conf
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Jan 6 21:55:03 UTC 2015
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196574
--- Comment #1 from logik at centrum.cz ---
The problem is probably on two places: following jail.conf, where no $name
redefinition is, leads to errors too: Maybe two substitutions on one line is
the problem here?
[root at platys ~]# jail -c dhcp
epair210a
dhcp: created
jail: dhcp: /sbin/ifconfig epair210b in192.168.6.210et up: failed
dhcp: removed
When I replace
exec.start += "/sbin/ifconfig epair${ip}b inet $ip_addr up" ;
with
exec.start += "/sbin/ifconfig epair210b inet $ip_addr up" ;
the problem disappear.
But two variables on line is not the only problem, because adding (after
correcting previous error) new line:
$name='dhcp';
throw the error mentioned in my first post:
[root at platys ~]# jail -c dhcp
epair210a
dhcp: created
ifconfig: 'vnet' requires argument
jail: dhcp: /sbin/ifconfig epair210b vnet: failed
dhcp: removed
jail.conf:
* {
exec.start = "/bin/bash /etc/rc";
exec.stop = "/bin/bash /etc/rc.shutdown";
exec.consolelog = "/var/log/jail/$name";
path = "/usr/jails/$name";
mount.fstab = "/etc/jail.fstab/$name";
host.hostname = "$name.dionyska.cz";
devfs_ruleset = "4";
mount.devfs;
mount.fdescfs;
$ip_addr = "192.168.6.${ip}" ;
}
dhcp {
$ip = "210" ;
$ip_route = "192.168.6.1" ;
vnet;
vnet.interface = "epair${ip}b";
exec.prestart = "ifconfig epair${ip}a destroy 2>/dev/null || true";
exec.prestart += "ifconfig epair$ip create up";
exec.prestart += "ifconfig bridge0 addm epair${ip}a";
exec.start = "/sbin/ifconfig lo0 127.0.0.1 up";
exec.start += "/sbin/ifconfig epair${ip}b inet $ip_addr up" ;
exec.start += "/sbin/route add default $ip_route " ;
exec.start += "/bin/sh /etc/rc";
exec.poststop = "ifconfig bridge0 delem epair${ip}";
exec.poststop = "ifconfig epair${ip}a destroy " ;
persist;
devfs_ruleset=5 ;
allow.raw_sockets=1 ;
allow.socket_af = 1;
}
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list