From owner-freebsd-jail@freebsd.org Wed Feb 15 01:48:32 2017 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D80A3CDFCA2 for ; Wed, 15 Feb 2017 01:48:32 +0000 (UTC) (envelope-from jmk@wagsky.com) Received: from bmx.allycomm.com (bmx.allycomm.com [198.199.108.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB9959F8 for ; Wed, 15 Feb 2017 01:48:32 +0000 (UTC) (envelope-from jmk@wagsky.com) Received: from jkletsky1-mbp15.guidewire.com (inet.guidewire.com [199.91.42.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by bmx.allycomm.com (Postfix) with ESMTPSA id D5FC8D7C9B; Tue, 14 Feb 2017 17:48:01 -0800 (PST) To: freebsd-jail@freebsd.org From: Jeff Kletsky Subject: Using jail.conf array parameters in exec.* commands Message-ID: Date: Tue, 14 Feb 2017 17:48:01 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 01:48:32 -0000 TL;DR Is there a patch available to allow substitution of "array" parameters into the strings used for exec.prestart, exec.poststop, and the like? Longer: I'd like to be able to use array parameters in exec.* commands, but trying to do so results in jail: test-two: exec.prestart: array cannot be substituted inline A quick check of the source didn't suggest it would work, but the bash-isms ${host.interface[*]} and ${host.interface[@]} failed too. The immediate application is in creating what will be the vnet.interface(s) using netgraph on the appropriate host interfaces vnet.interface = ng0, ng1; Works well, once the interfaces are created, but I'd rather not have to define that list twice in each jail. If I could write something like: vnet.interface = ng0, ng1; host.interface = re0, re0.100; and then iterate over them in the prestart and poststop scripts to: * Create ng0 connected to re0 * Create ng1 connected to re0.100 it would be easier to maintain than having to write something like: vnet.interface = ng0, ng1; parent.interfaces = "re0 re0.100"; cloned.interfaces = "ng0 ng1"; I'm open to ideas here, including if I can somehow "write back" to vnet.interface based on exec.prestart parsing the "custom" variables. TIA, Jeff