From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Mon 19 May 2003 - 08:50:57 BST
On Fri, Apr 11, 2003 at 05:37:18PM +0300, Lyashkov Alex wrote:
Sorry Alex!
stumbled across this unanswered/unread mail today ...
> On Friday 11 April 2003 10:23, Herbert Poetzl wrote:
> > On Fri, Apr 11, 2003 at 07:47:24AM +0300, Lyashkov Alex wrote:
> > some kind of kill-every-process in one context
> > would be nice ...
> >
> > consider the folowing script (or try it on your box)
> > ...
> it's fork bomb :)
correct ... unfortunately, some dubious people (users)
can't stop trying to experiment with self restarting
scripts and/or programs ...
> > start it in a vserver with, lets say a limit
> > of 1000 processes (maximum) and try to kill
> > these thing once started ... it's not trivial ...
> >
> trivial.
> It's need add new command in new_s_context syscall.
> "stop_vserver".
> My patch have list all process in context.
> code for this simular:
>
> write_lock(&task_lock); // exclusive blocking.
> for_each_task_in_context(ctx,tsk)
> {
> task_t *task = tsk->task;
> force_sig(SIGKILL,task); // or SIGTERM
> }
> write_unlock(&task_lock);
> and block creating new process in context.
>
> correctly ?
sounds good ...
I had some thought on this issue, and I guess it would
be the best solution, to freeze all processes (not
with SIG_STOP but) by NOT scheduling any of the vserver
tasks anymore? why?
- you could have a good look at the processes from
outside (couldn't you?)
- you probably could send any signal from ctx-1 or
from vserver <ctx> enter? (am I wrong?)
- after unfreezing SIG_KILL signalled processes, it
should have the same effect as the kernel loop
above (shouldn't it?)
what do you think about? let me know!
best,
Herbert
> --
> With best regards,
> Alex