From owner-freebsd-arch@FreeBSD.ORG Wed Oct 21 22:54:34 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AE98106566C for ; Wed, 21 Oct 2009 22:54:34 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8538FC12 for ; Wed, 21 Oct 2009 22:54:33 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 076006D41C; Wed, 21 Oct 2009 22:54:33 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C1CA2844E9; Thu, 22 Oct 2009 00:54:32 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ed Schouten References: <20091021222054.GJ1293@hoeg.nl> Date: Thu, 22 Oct 2009 00:54:32 +0200 In-Reply-To: <20091021222054.GJ1293@hoeg.nl> (Ed Schouten's message of "Thu, 22 Oct 2009 00:20:54 +0200") Message-ID: <86ljj4s6hj.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Arch Subject: Re: Setting the jail identifier from /etc/rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2009 22:54:34 -0000 Ed Schouten writes: > I haven't played with Jails for a long time, but I wanted to figure out > how hard it is to make init spawn getties for certain jails. It > shouldn't be too hard (jexec foo /usr/libexec/getty), but I can't seem > to find a way to set the jid to a certain value from within rc.conf. The jid is a number assigned by the kernel which increases monotonically for every jail created. If you stop and restart a jail, it will get a new jid. If you're thinking of the jail name as specified in rc.conf, that's internal to the rc script - it is not passed to the kernel. The kernel's idea of the jail name defaults to the string representation of the jid (i.e. a jail with jid 4 is named "4" unless otherwise specified on the command line). There is no rc.conf variable for it, but you can add "-n foo" to jail_foo_flags. (it seems /etc/rc.d/jail hasn't quite caught up with the new jail(8) command line syntax) Currently, your best bet is probably to read the jid from /var/run/jail_${foo}.id, which is created by the rc script when it starts the jail. > It also seems jids cannot contain dots, which means I cannot set the jid > equal to the hostname of the jail. The jail name can not contain dots because jails can nest, and dots are used to separate components in the fully qualified name of a jail. If you start a jail named "foo", and within "foo" start a jail named "bar", then the fully qualified name of the inner jail is "foo.bar". DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no