> a) Kill the controlling shell.  This will leave some processes behind that
>    are no longer part of the user's session (like programs that have
>    detatched from the terminal and become daemons), and processes that
>    were never part of the user's session (like processes that they started
>    on a different terminal)
> 
> b) kill -<signal> `ps -axo user,pid | grep user | awk '{print $2}'`
>    Kills every process owned by ``user''.  Sending SIGKILL does so
>    in a non-catchable way.
> 
> c) /sbin/halt is pretty much guaranteed to do the trick ;-)

d) revoke() their tty

I used to do variations on a) and b) above, but it's messy, time consuming,
error prone, and requires ugly changes every time someone changes ps output,
features, or whatever.

I wrote a little line program to do a revoke(), it was basically

int main(int argc, char *argv[]) { revoke(argv[1]); }

Now this doesn't kill a darn thing.  And you should be aware of it!  But it
does forcibly "close" any open fd's pointing at the tty in question, and
most programs will get the hint and go away.

For some uses, especially predictable uses, this is probably a lot simpler
and a lot more foolproof.
-- 
... Joe

-------------------------------------------------------------------------------
Joe Greco - Systems Administrator                             [EMAIL PROTECTED]
Solaria Public Access UNIX - Milwaukee, WI                         414/342-4847


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to