From owner-freebsd-questions@freebsd.org Mon Dec 14 22:48:39 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69A064C8DD1 for ; Mon, 14 Dec 2020 22:48:39 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from gritton.org (gritton.org [199.192.165.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CvxPz23Syz4T3d; Mon, 14 Dec 2020 22:48:39 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from gritton.org ([127.0.0.131]) (authenticated bits=0) by gritton.org (8.15.2/8.15.2) with ESMTPA id 0BEMmVBD085067; Mon, 14 Dec 2020 14:48:31 -0800 (PST) (envelope-from jamie@gritton.org) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 14 Dec 2020 14:48:31 -0800 From: James Gritton To: mj-mailinglist@gmx.de Cc: freebsd-questions@freebsd.org, Kyle Evans Subject: Re: Aw: Re: Questions about the output of jls In-Reply-To: References: <72165e2885787561bd7fc7384c7b03b8@gritton.org> User-Agent: Roundcube Webmail/1.4.1 Message-ID: <717b06895f048961caa772dcd325b66f@gritton.org> X-Sender: jamie@gritton.org X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (gritton.org [127.0.0.131]); Mon, 14 Dec 2020 15:48:32 -0700 (MST) X-Rspamd-Queue-Id: 4CvxPz23Syz4T3d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2020 22:48:39 -0000 On 2020-12-14 12:58, mj-mailinglist@gmx.de wrote: >>> On Sun, Dec 13, 2020 at 10:04 AM wrote: >>>> >>>> Hi, >>>> >>>> I habe a current system, where i have current and 12.2-STABLE jails. >>>> Checking with jls, i get this output: >>>> >>>> root@fbsd13:~ # jls -h jid name ip4.addr host.hostname vnet >>>> osrelease >>>> path | column -t >>>> jid name ip4.addr host.hostname vnet osrelease path >>>> 8 j0 192.168.0.10 j0.local 2 13.0-CURRENT /jails/j0 >>>> 10 j1 - j1.local 1 13.0-CURRENT /jails/j1 >>>> 12 j2 - j2.local 1 13.0-CURRENT /jails/j2 >>>> >>>> the jails are running this versions: >>>> >>>> root@fbsd13:~ # jexec -l j0 freebsd-version -u >>>> 12.2-STABLE >>>> root@fbsd13:~ # jexec -l j1 freebsd-version -u >>>> 13.0-CURRENT >>>> root@fbsd13:~ # jexec -l j2 freebsd-version -u >>>> 12.2-STABLE >>>> >>>> >>>> What is "osrelease"? Looking at the name, i would have guessed, it >>>> is >>>> the >>>> version of the freebsd userland, running in the jail. But it does't >>>> seem so. >>>> j1 and j2 are VNET jails, so it seems the 1 in the vnet column >>>> signifies this, >>>> j0 is a "standard" jail using the hosts network stack, so the 2 >>>> stands >>>> for standard? >>>> >>> >>> Hi, >>> >>> osrelease is what the jail sees as kern.osrelease and uname -r (see: >>> jail(8)) (i.e. kernel version); it's either specified during jail >>> creation or inherited from the parent prison if none is specified. >>> >>> It looks like it's exporting a jailsys int for vnet, so these >>> correspond to: >>> >>> JAIL_SYS_DISABLE=0 >>> JAIL_SYS_NEW=1 >>> JAIL_SYS_INHERIT=2 >>> >>> So 2 is 'use parent vnet', 1 is 'new one created' -- I don't see this >>> described in either jls(1) or jail(8), it'd probably be nice if we >>> translated jailsys ints into "new"/"inherit" since one specifies >>> "new"/"inherit" for them during creation. >> >> True, that would be more human-readable. For that matter, I could >> report booleans (such as allow.whatever) as "true" or "false" as well. >> In both cases, the strings pass back to jail(8) OK, but I wonder if >> there are any scripts out there that actually use those values in >> their >> numeric form. >> >> - Jamie > > Thanks, > > I did not realise, that osrelease and osreldate are "writable". > When setting them in jail.conf they are shown by jls: > > root@fbsd13:~ # jls -h jid name vnet ip4.addr host.hostname osrelease > osreldate path | column -t > jid name vnet ip4.addr host.hostname osrelease osreldate > path > 26 j0 2 192.168.0.10 j0 12.2-STABLE 1202504 > /jails/j0 > 27 j1 1 - j1 13.0-CURRENT 1300131 > /jails/j1 > 28 j2 1 - j2 12.2-STABLE 1202504 > /jails/j2 > 29 j4 1 - j4 12.2-STABLE 1202504 > /jails/j4 > 33 j5 2 192.168.0.15 j5 12.2-STABLE 1202504 > /jails/j5 > > > > the representation of the vnet value differs, depending on the used > jls parameters: > > root@fbsd13:~ # jls -j j0 -h vnet > vnet > 2 > > root@fbsd13:~ # jls -j j1 -h vnet > vnet > 1 > > and > > root@fbsd13:~ # jls -j j0 -n > devfs_ruleset=4 nodying enforce_statfs=2 host=new ip4=disable > ip6=disable > jid=26 name=j0 osreldate=1202504 osrelease=12.2-STABLE parent=0 > path=/jails/j0 > nopersist securelevel=-1 sysvmsg=new sysvsem=new sysvshm=new > vnet=inherit ... > > root@fbsd13:~ # jls -j j1 -n > devfs_ruleset=4 nodying enforce_statfs=2 host=new ip4=inherit > ip6=inherit > jid=27 name=j1 osreldate=1300131 osrelease=13.0-CURRENT parent=0 > path=/jails/j1 > nopersist securelevel=-1 sysvmsg=new sysvsem=new sysvshm=new vnet=new > ... Well, that's interesting. It makes sense that the "-n" parameters have to be something that would work passed to jail(8), but I'm glad to be reminded I used the text values (the numbers would have worked). And that means changing the other output is half done already! - Jamie