From owner-cvs-src@FreeBSD.ORG Wed Apr 9 18:15:03 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A710637B401; Wed, 9 Apr 2003 18:15:03 -0700 (PDT) Received: from espresso.bsdmike.org (espresso.bsdmike.org [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id E146143F93; Wed, 9 Apr 2003 18:15:00 -0700 (PDT) (envelope-from mike@espresso.bsdmike.org) Received: by espresso.bsdmike.org (Postfix, from userid 1002) id 650ED9C68; Wed, 9 Apr 2003 21:00:48 -0400 (EDT) Date: Wed, 9 Apr 2003 21:00:48 -0400 From: Mike Barcroft To: Pawel Jakub Dawidek Message-ID: <20030409210048.G16782@espresso.bsdmike.org> References: <200304090304.h3934Csu028105@repoman.freebsd.org> <20030408225808.A16782@espresso.bsdmike.org> <20030409142231.GX1280@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030409142231.GX1280@garage.freebsd.pl>; from nick@garage.freebsd.pl on Wed, Apr 09, 2003 at 04:22:31PM +0200 Organization: The FreeBSD Project cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/killall killall.1 killall.c src/usr.sbin Makefile src/usr.sbin/jail jail.8 jail.c src/usr.sbin/jexec Makefile jexec.8 jexec.c src/usr.sbin/jls Makefile jls.8 jls.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 01:15:04 -0000 Pawel Jakub Dawidek writes: > On Tue, Apr 08, 2003 at 10:58:08PM -0400, Mike Barcroft wrote: > +> Here's what it looks like in use: > +> > +> %%% > +> sol# jail /tmp/jail localhost 127.0.0.1 /bin/sh & > +> [1] 19114 > +> sol# jail /tmp/jail localhost 127.0.0.1 /bin/csh & > +> [2] 19139 > +> [1] + Suspended (tty input) jail /tmp/jail localhost 127.0.0.1 /bin/sh > +> sol# jls > +> JID IP Address Hostname Path > +> 2 127.0.0.1 localhost /tmp/jail > +> 1 127.0.0.1 localhost /tmp/jail > > Nice work!! Global list with all prisons was really needed. > > But IMHO JID should be a string, not a number. For example we're running > many jails at startup or somewhere else and because JID is set > dynamicly there could be problems in writing scripts for handle jails > (attaching processes to it or something). > As we can see on your example, we aren't able to find out which > jail was ran first (looking at PIDs isn't good idea:)). > If JID will be a string there will be no such problems. > > What you think? Can't you just use jail -i and save the JID number for later use? BTW, I think I need an fflush() after the printf() call in jail(8), otherwise when block buffering is used to save the output to a file instead of the terminal, nothing is written. Best regards, Mike Barcroft