Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Jan 2015 21:55:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 196574] Bug in parsing jail.conf
Message-ID:  <bug-196574-8-pF2mRcznFr@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-196574-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-196574-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196574

--- Comment #1 from logik@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@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@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-196574-8-pF2mRcznFr>