From owner-freebsd-questions@FreeBSD.ORG Fri Jul 12 16:12:35 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A1D44FD2 for ; Fri, 12 Jul 2013 16:12:35 +0000 (UTC) (envelope-from markham_breitbach@ssimicro.com) Received: from mail.ssimicro.com (mail.ssimicro.com [64.247.129.10]) by mx1.freebsd.org (Postfix) with ESMTP id 29E291E33 for ; Fri, 12 Jul 2013 16:12:34 +0000 (UTC) Received: from markham.ssimicro.com (markham.ssimicro.com [64.247.130.99]) by mail.ssimicro.com (8.14.4/8.14.5) with ESMTP id r6CGAdJY099573 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT) for ; Fri, 12 Jul 2013 10:10:40 -0600 (MDT) Message-ID: <51E02A7F.8090706@ssimicro.com> Date: Fri, 12 Jul 2013 10:10:39 -0600 From: markham breitbach User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: jls usage References: <51DF59B1.4020107@a1poweruser.com> <13CA24D6AB415D428143D44749F57D7201FBF9CF@ltcfiswmsgmb21> <51DFCDD2.2010104@fjl.co.uk> <13CA24D6AB415D428143D44749F57D7201FC19A4@ltcfiswmsgmb21> <51E01A22.7030306@fjl.co.uk> <51E021AA.5030905@fjl.co.uk> <51E02729.7070203@fjl.co.uk> In-Reply-To: <51E02729.7070203@fjl.co.uk> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 16:12:35 -0000 On 13-07-12 9:56 AM, Frank Leonhardt wrote: > On 12/07/2013 16:32, Frank Leonhardt wrote: >> I've tried using the actual jail name, and the hostname to be sure - nothing - and on >> checking (jls -v) I'm somehow ending up with the Name being the same as the ID. I just >> put this down to a quirk/bug (it's there in 8.2-9) but it sounds like it's not an issue >> for anyone else. I'm defining them in rc.conf: >>>>> >>>>> jail_enable="yes" >>>>> jail_list="one two three" >>>>> >>>>> jail_agnet_rootdir="/usr/jail/one" >>>>> jail_agnet_hostname="one.mydomain.com" >>>>> jail_agnet_ip="123.123.123.123" >>>>> jail_agnet_devfs_enable="yes" >>>>> jail_agnet_devfs_ruleset="devfsrules_jail" >>>>> >>>> You've configured "one" and "two" and "three" in your jail_list, but quite oddly... >>>> >>>> You have not defined "jail_one_*" or "jail_two_*" or "jail_three_*". >>>> >>>> I'm extremely confused as to how your jail even started! >>> >>> Sorry - should have said I'd obfuscated the IP addresses and hostnames (it's not >>> really "one.mydomain.com" ;-) ) Unfortunately I forgot to obfuscate the jail name as >>> fully as I thought in the startup lines. It should have read jail_one_rootdir &c. >>> >>> As I said, it's been working happily for years on lots of different installations and >>> they're all configured the same. The only weirdness is that the jail name appears in >>> the table as it's number. >> >> A further clarification - I know using the jail utility defaults the jail name to that >> of its ID if you don't specify one, and presume this is the mechanism messing it up >> here. However as I've gone to the trouble of configuring them in rc.conf with names, >> listing said names in jail_list and when commands like: >> >> service jail start one >> service jail stop one >> >> work just fine, I don't see what I'm doing wrong! Incidentally, it doesn't matter if I >> start them at boot time or start/stop later - the jail name always sets to the jail-iD, >> and not the name specified. I suspect a bug in the rc.d script, but I can't be the >> first person to notice, can I??? I'll take a look. >> > > Okay - answering my own question and solved... It's a bug (or is that a feature?). > > In /etc/rc.d/jail line 647 it currently reads: > > eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ > \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ > > And it should (IMHO) read: > > eval ${_setfib} jail ${_flags} -n ${_jail} -i ${_rootdir} ${_hostname} \ > \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \ > > Once changed, everything works find and your jails are named as per the rc.conf file > definitions. Can anyone think of a reason for NOT fixing this? > > Regards, Frank. > > > I see where you are defining a hostname, but not a jail name. Jail name cannot contain the "." character. -Markham