Re: active/inactive jails

From: Barry Pederson <bp_at_barryp.org>
Date: Fri, 06 Jun 2008 09:29:54 -0500
Oliver Fromme wrote:
> Michael Reifenberger wrote:

>  > Is there an convinient way to get the processes associatet with
>  > an jail.
> 
> ps(1) can display the jail numbers:  "ps -o jid,command"
> (JID 0 means the host system).  You can easily filter the
> output by jail ID.  If you don't know the jail ID, use
> jls(8) to find the jail by hostname, IP number or chroot
> path (which only works if you keep them unique, of course).
> 
> I once wrote a script called "jps" that makes it a little
> easier.  "jps" lists all jailed processes with their JID,
> and "jps <JID>" lists only the processes that belong to
> the specified JID.
> 
> http://www.secnetix.de/olli/scripts/jps

I think pgrep(1) is what you're looking for here.  Once you find the 
jail ID with jls(8), you can run

    pgrep -lf -j <jail_id>

to get a list if processes for that particular jail.

	Barry
Received on Fri Jun 06 2008 - 13:07:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:31 UTC