X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fvserverkillall;fp=scripts%2Fvserverkillall;h=0000000000000000000000000000000000000000;hb=780710c3d80b8776944dd1fc65a0fda64f399db0;hp=f49f33929cf0fa4296efd26ddc4135c3eba4cb4c;hpb=8cf13bb177d92c93eb73dc8939777150536c2d00;p=util-vserver.git diff --git a/scripts/vserverkillall b/scripts/vserverkillall deleted file mode 100755 index f49f339..0000000 --- a/scripts/vserverkillall +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2003 Enrico Scholz -# based on vserverkillall by Jacques Gelinas -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# This script kills all process it can finds -# Only useful if you are using a security context. -# It does nothing in context 0 -USR_LIB_VSERVER=$(dirname $0) -CTX=`grep ^s_context /proc/self/status | sed s/s_context:// | (read a b; echo $a)` -CTX=`eval expr $CTX + 0` -if [ "$CTX" = 0 ] ; then - echo Running in security context 0, do nothing -else - cd /proc - for SIG in -TERM -TERM -TERM -9 - do - ONE=0 - for dir in * - do - case $dir in - 1) - ;; - $$) - ;; - [1-9]*) - ONE=1 - echo kill $SIG "`$USR_LIB_VSERVER/readlink /proc/$dir/exe`"[$dir] - kill $SIG $dir - ;; - *) - ;; - esac - done - if [ "$ONE" = 0 ] ; then - break - fi - sleep 1 - done - # Kill the fakeinit process. It is shown as process one, but can't - # be killed this way - INITPID=`cat /proc/self/status | grep initpid: | (read a b; expr $b)` - if [ "$INITPID" != "0" ] ; then - echo kill init, pid $INITPID - kill -9 $INITPID - fi -fi - -