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
Tue Apr 8 20:12:20 PDT 2003


Mike Barcroft <mike at FreeBSD.org> writes:
> mike        2003/04/08 20:04:12 PDT
> 
>   FreeBSD src repository
> 
>   Modified files:
>     usr.bin/killall      killall.1 killall.c 
>     usr.sbin             Makefile 
>     usr.sbin/jail        jail.8 jail.c 
>   Added files:
>     usr.sbin/jexec       Makefile jexec.8 jexec.c 
>     usr.sbin/jls         Makefile jls.8 jls.c 
>   Log:
>   o Add jls(8) for listing active jails.
>   o Add jexec(8) to execute a command in an existing jail.
>   o Add -j option for killall(1) to kill all processes in a specified
>     jail.
>   o Add -i option to jail(8) to output jail ID of newly created jail.

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
[2]  + Suspended (tty input)         jail /tmp/jail localhost 127.0.0.1 /bin/csh
sol# jexec 2 /bin/ps -auxww
USER   PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED      TIME COMMAND
0    19139  0.0  0.1  1268  708  p4  TJ    3:09AM   0:00.03 /bin/csh
0    19217  0.8  0.1   640  312  p4  R+J   3:09AM   0:00.01 /bin/ps -auxww
sol# jexec 1 /bin/csh
%ps -auxww
USER   PID %CPU %MEM   VSZ  RSS  TT  STAT STARTED      TIME COMMAND
0    19114  0.0  0.1   872  444  p4  TJ    3:08AM   0:00.02 /bin/sh
0    19318  0.8  0.2  1504 1200  p4  SJ    3:09AM   0:00.04 /bin/csh
0    19331  0.0  0.1   640  440  p4  R+J   3:09AM   0:00.01 ps -auxww
%exit
sol# killall -KILL -j 2
[2]  - Killed                        jail /tmp/jail localhost 127.0.0.1 /bin/csh
sol# killall -KILL -j 1
[1]  + Killed                        jail /tmp/jail localhost 127.0.0.1 /bin/sh
sol# jls
sol# 
%%%

Best regards,
Mike Barcroft


More information about the cvs-src mailing list