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

Mike Barcroft mike at FreeBSD.org
Wed Apr 9 18:15:04 PDT 2003


Pawel Jakub Dawidek <nick at garage.freebsd.pl> 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


More information about the cvs-src mailing list