From owner-freebsd-questions@FreeBSD.ORG Fri Jul 12 09:35:42 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BBCE7BF5 for ; Fri, 12 Jul 2013 09:35:42 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) by mx1.freebsd.org (Postfix) with ESMTP id 61CCD195C for ; Fri, 12 Jul 2013 09:35:42 +0000 (UTC) Received: from [192.168.1.35] (mux.fjl.org.uk [62.3.120.246]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id r6C9ZYiW012144 (version=TLSv1/SSLv3 cipher=DHE-DSS-CAMELLIA256-SHA bits=256 verify=NO) for ; Fri, 12 Jul 2013 10:35:35 +0100 (BST) (envelope-from frank2@fjl.co.uk) Message-ID: <51DFCDD2.2010104@fjl.co.uk> Date: Fri, 12 Jul 2013 10:35:14 +0100 From: Frank Leonhardt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; 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> In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FBF9CF@ltcfiswmsgmb21> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 09:35:42 -0000 On 12/07/2013 02:33, Teske, Devin wrote: > On Jul 11, 2013, at 6:19 PM, Fbsd8 wrote: > >> In a .sh script I'm trying to get the jid for a single jail using this code >> >> jid=`jls -j jailname | cut -f 1- | awk '{print $1}'` >> > Looks a little over complicated... why not just.. > > jls -j jailname jid I've never got the -j option to work on jail names, only jail IDs. 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" etc... jls -v produces: JID Hostname Path Name State CPUSetID IP Address(es) 1 one.mydomain.com /usr/jail/one 1 ACTIVE 2 123.123.123.123 Everything works just fine, and has done for years, except jls -j jailname. It's zero-impact on me as it's no problem referring to them by number (which doesn't change) but if anyone could tell me what I'm doing wrong I'd be very interested to know. Or at least it'd be good to know I'm not the only one with the problem. Thanks, Frank.