Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jun 2002 14:37:54 -0300 (ART)
From:      Fernando Gleiser <fgleiser@cactus.fi.uba.ar>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        Roman Neuhauser <neuhauser@bellavista.cz>, Alexey Privalov <lucky@land3.nsu.ru>, freebsd-questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: kicking users
Message-ID:  <20020618142307.N66694-100000@localhost>
In-Reply-To: <20020618161438.GA84123@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 18 Jun 2002, Dan Nelson wrote:

> In the last episode (Jun 18), Roman Neuhauser said:
> >
> >     which is not exactly what i was after. i needed to cut off a user
> >     "right now, regardless of what they're doing" (or rather, just
> >     because of the stuff they're doing).
>
> In that case, just kill -9 their shell.  Or to kill all processes
> running under their userid,  kill -9 $( ps -xU <username> -o pid= )

Don't use kill -9. The shell ignores SIGTERM (-15) but responds to a SIGHUP.
If you kill -HUP the login shell, it will kill all of his children and then
exit. This is from the time when modem connected and serial terminals were
common, the kernel sends a SIGHUP to the login shell if you 'hang up' the
phone.

Sending a SIGKILL (-9) is a last resort and should be used only when
everyting else fails. You should give the process a chance to terminate
gracefully and do the proper clean up.

If you kill -9 a process, it just dies. You may need to do the clean up
by hand later (delete stale lockfiles, delete temp files, kill the orphaned
children and the like) and that is way more work than trying to kill it with
a less drastic signal in the first place.



			Fer
				Fer

>
> --
> 	Dan Nelson
> 	dnelson@allantgroup.com
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020618142307.N66694-100000>