Re: rctl -u jail:0

From: James Gritton <jamie_at_freebsd.org>
Date: Fri, 11 Jun 2021 17:00:46 UTC
On 2021-06-10 17:37, Johannes Totz wrote:
> what does
> 
> $ rctl -u jail:0
> 
> report? Is that supposed to work? Output looks like:
> 
> cputime=10507
> datasize=6946816
> stacksize=520495104
> coredumpsize=0
> memoryuse=403210240
> memorylocked=0
> maxproc=87
> openfiles=6992
> vmemoryuse=1918025728
> pseudoterminals=1
> swapuse=37552128
> nthr=95
> msgqqueued=0
> msgqsize=0
> nmsgq=0
> nsem=0
> nsemop=0
> nshm=0
> shmsize=0
> wallclock=443440
> pcpu=0
> readbps=512
> writebps=0
> readiops=1
> writeiops=0
> 
> 
> maxproc looks alright but the rest seems to be all over the place...
> I don't have a jail called "0". For an actually existing jail the
> output looks fine.
> I checked the source and looks like code that parses the jail name is
> just a string comparison, no check for jail id.
> 
> Side note: I was trying to get stats for all processes not in a jail.
> Any suggestions for that?
> 
> I'm still on 12-stable.

In many utilities, jail 0 is shorthand for the non-jailed system
itself.  Or if you're running withing a jail, it means the jail you're
currently running in (as the system itself is inaccessible).  Not all
utilities support this notation; notably jail(8) itself only deals
with visible jails and not the containing system.

- Jamie