Re: Exiting VC from another
On Mon, 27 Oct 1997, PATRICK DAHIROC wrote:
> I'm just wandering, but is there any way to logout of a Virtual
> Console from another Console (i.e. logout of tty1 from tty2)? The
> reason I ask this is I managed to hang tty1 and I had to kill all
> process on tty1 from tty2 and then rebooted the system. Is there a
> more elegant way of doing this?
a common way to do things like that is to use 'ps' and 'kill'.
'ps -t1' will give you a list of all processes which are running on
tty1. e.g.
$ ps -t1
PID TT STAT TIME COMMAND
385 1 S 0:00 -bash
then use 'kill' to kill off any processes that it lists. e.g. 'kill
385'. some processes may be "reluctant to die" :-)...if so, use SIGKILL
(9) rather than the default SIGTERM (15). e.g. 'kill -9 385'.
The difference is that SIGTERM tells the application to "clean up
and exit now please", whereas SIGKILL just kills it without warning.
Obviously it is nearly always better to give a process a chance to
terminate gracefully with SIGTERM. nuking it with 'kill -9' is a last
resort.
occassionally (rarely, these days :-) you'll run into a process
that won't die even with 'kill -9'. this means that the process
is lost in the kernel somewhere (i.e. has called a kernel routine
which hasn't returned yet). the process won't die until that routine
returns....sometimes, with buggy kernels or faulty hardware the kernel
function will never return, so the process will never die. you have two
choices here: ignore it or reboot.
see man pages for ps, and kill. see also 'kill -l' (that's lowercase
letter "l", not the numeral one) for a list of signals which can be sent
to processes with kill.
craig
--
craig sanders
networking consultant Available for casual or contract
temporary autonomous zone system administration tasks.
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: