Date: Mon, 26 Nov 2001 00:50:19 +0300 (MSK) From: "."@babolo.ru To: gshapiro@FreeBSD.ORG (Gregory Neil Shapiro) Cc: evms@cs.bu.edu, freebsd-stable@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: jail patch Message-ID: <200111252150.AAA28384@aaz.links.ru> In-Reply-To: <15361.9475.891401.44730@horsey.gshapiro.net> from "Gregory Neil Shapiro" at "Nov 25, 1 09:06:11 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Gregory Neil Shapiro writes: > evms> I wrote this a while ago, but, if anyone is interested, please > evms> take a look: this module implements a system call that takes > evms> a u_int_32t. This system call, named killjail, kills all processes > evms> which belong to the jail which uses that particular IP address. > > evms> I included it in a tar with a makefile and with a program > evms> that uses it. (Eg: ./killjail 1.2.3.4) > > evms> http://www.sekt7.org/kjs.tar > > evms> Works on 4.4 but can be easily ported to 5.0. > > This can be done in userland without kernel interaction: > > #!/bin/sh > > EX_OK=0 > EX_USAGE=64 > > if [ "$1" = "" ] > then > echo "Usage: $0 jailname" > exit ${EX_USAGE} > fi > > pids=`grep -l " $1\$" /proc/*/status | awk -F/ '{print $3}'` > if [ "$pids" != "" ] > then > kill -15 $pids 2> /dev/null > fi > exit ${EX_OK} This programm selects process by jail host name instead of by jail itself. For example I have about 40 jails with the same host name and IP address (they occupy different ports). -- @BABOLO http://links.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111252150.AAA28384>