From owner-freebsd-current@FreeBSD.ORG Fri Jun 6 15:07:51 2008 Return-Path: Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45741106564A for ; Fri, 6 Jun 2008 15:07:51 +0000 (UTC) (envelope-from bp@barryp.org) Received: from itasca.hexavalent.net (itasca.hexavalent.net [67.207.138.180]) by mx1.freebsd.org (Postfix) with ESMTP id 371AF8FC16 for ; Fri, 6 Jun 2008 15:07:51 +0000 (UTC) (envelope-from bp@barryp.org) Received: from host-42-60-230-24.midco.net ([24.230.60.42] helo=eden.barryp.org) by itasca.hexavalent.net with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.67) (envelope-from ) id 1K4cx7-0004tM-0V for freebsd-current@FreeBSD.ORG; Fri, 06 Jun 2008 09:30:01 -0500 Received: from octane.med.und.nodak.edu ([134.129.166.23]) by eden.barryp.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.67 (FreeBSD)) (envelope-from ) id 1K4cx0-0008h8-Vy; Fri, 06 Jun 2008 09:29:55 -0500 Message-ID: <484949E2.8080208@barryp.org> Date: Fri, 06 Jun 2008 09:29:54 -0500 From: Barry Pederson User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: freebsd-current@FreeBSD.ORG, mike@reifenberger.com References: <200806060742.m567g8hn087608@lurza.secnetix.de> In-Reply-To: <200806060742.m567g8hn087608@lurza.secnetix.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: active/inactive jails X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2008 15:07:51 -0000 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 " 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 to get a list if processes for that particular jail. Barry