Re: killing all processes of one user reliably
- From: Tomasz Noiński <noix@xxxxxxxxx>
- Date: Wed, 31 Jan 2007 16:39:51 +0000 (UTC)
Dnia Wed, 31 Jan 2007 06:22:54 -0800, patrick napisał(a):
I've been researching ways to kill all processes of one user (while
being root, of course) and I couldn't find _one_ program doing it
without race conditions.
I think the most popular such programs are "skill" (from procps) and
"slay".
The program is called "kill" -- why re-invent the wheel?
kill -9 `ps -u username | grep -v TTY | awk '{print $1}'`
Because it doesn't always work!
Your one-liner effectively does the same as "skill" and is prone to the
same race condition. It is even easier to win this race because it's
slower (shell commands vs C program).
Let's say you have a server and one of your users does something really
bad. You disable his cron jobs, "at" jobs, disallow logging through ssh,
delete all his files etc. But the user managed to start a bunch of
"antiskill.c" programs from the webpage I mentioned. Even if you run your
one-liner lots of times, it won't work.
What do you do? Reboot the server?
Noix
.
- References:
- killing all processes of one user reliably
- From: Tomasz Noiński
- Re: killing all processes of one user reliably
- From: patrick
- killing all processes of one user reliably
- Prev by Date: Re: killing all processes of one user reliably
- Next by Date: Re: killing all processes of one user reliably
- Previous by thread: Re: killing all processes of one user reliably
- Next by thread: Re: killing all processes of one user reliably
- Index(es):
Relevant Pages
|