From owner-freebsd-jail@FreeBSD.ORG Sun Mar 31 20:01:15 2013 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55D587D0 for ; Sun, 31 Mar 2013 20:01:15 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id 1958ED4F for ; Sun, 31 Mar 2013 20:01:14 +0000 (UTC) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 1F06F28439; Sun, 31 Mar 2013 22:01:13 +0200 (CEST) Received: from [192.168.1.2] (ip-89-177-49-222.net.upcbroadband.cz [89.177.49.222]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 0C0AF28437; Sun, 31 Mar 2013 22:01:12 +0200 (CEST) Message-ID: <51589607.7040401@quip.cz> Date: Sun, 31 Mar 2013 22:01:11 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.19) Gecko/20110420 Lightning/1.0b1 SeaMonkey/2.0.14 MIME-Version: 1.0 To: Dirk Engling Subject: Re: rc.d/jail and jail.conf References: <515721F8.9090202@erdgeist.org> <51574D3F.9040300@quip.cz> <51588435.2010400@erdgeist.org> In-Reply-To: <51588435.2010400@erdgeist.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-jail@freebsd.org X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Mar 2013 20:01:15 -0000 Dirk Engling wrote: > On 30.03.13 21:38, Miroslav Lachman wrote: > >> jail_myjail_flags="-l -U root -n myjail" > > When trying to pass a my hostname (foo.com) as jailname like that, > jail(8) will complain > > jail: jail "foo" not found > > as it does not allow periods in the jailname. This seems like an > unfortunate limitation, as I tend to name my jails after the fqdn they > are being started as. > > FYI, the name=myjail form did not work, because rc.d/jail uses the > > path hostname [ip[,...]] command ... > > synopsis of the jail command, which fails, if it sees name=value params. I am sorry for misinform you with name=myjail in rc.conf, I didn't try it because I am using an old way with -n jailname on my older boxes and I am planing to use new syntax only with jail.conf (after problem with mounting of devfs will be fixed). > So I guess, I am out of luck here, because users used to think of their > jails as what they saw in the hostname field on jls. If I am writing > tools that use jail_getid to map the jailname to the jid, it will never > match that hostname and I also can not copy the hostname to the jailname. > > Is there a reason for '.' being the only excluded character in the jailname? I understand what you are talking about, but jails in these days are something different from what jails were at the begining in 4.x days and users must accept that jailname is something different than hostname. In these days, you can have jails with many IP addresses or without IP address. Hostname needn't to be unique etc. Dot (.) is not allowed in jailname because of hierarchical jails, where dot is used as hierarchy separator. So jailname foo.bar.baz means foo is top level jail, bar is its child and baz is child in bar. Plain jls without any options should be used just for backward compatibility with old scripts, because its output is insufficient for todays jails. (only one IP is shown and no jailname) jls -v or jls -s is better with new jails. Miroslav Lachman