Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

kill tty

Status
Not open for further replies.

AIXFinder

IS-IT--Management
Jan 4, 2007
97
US
How do you kill i.e. this tty session?

User tty login@ idle JCPU PCPU what
root pts/0 Thu11AM 21:20 5:24 0 -ksh

thx much
 
ps -ft pts/0

Then kill the process that is running there (the "-ksh" process) But you want to make sure nothing else is running as subprocess from the "-ksh" process.


HTH,

p5wizard
 
Yeah i agree with what p5wizard said

just take the pid out of this command and use ps again to located any subprocesses to avoid zombies!

ps -ef | grep pid

regards,
Khalid
 
PDC # w
10:36AM up 5 days, 18:11, 1 user, load average: 0.00, 0.01, 0.01
User tty login@ idle JCPU PCPU what
root pts/0 Thu11AM 0 1:46 0 /usr/bin/w64
You have mail in /usr/spool/mail/root
root:/>
PDC # ps -ft pts/0
UID PID PPID C STIME TTY TIME CMD
root 688328 421946 0 Mar 01 pts/0 0:00 -ksh
root 892980 696450 0 Mar 01 pts/0 0:00 -ksh
root 1134738 892980 0 10:36:30 pts/0 0:00 ps -ft pts/0
root:/>
PDC # ps -ef |grep 688328
root 688328 421946 0 Mar 01 pts/0 0:00 -ksh
root 852194 892980 0 10:37:08 pts/0 0:00 grep 688328
 
It is confusing if I can remove the PID or not.
 
Well, I'd start a new telnet/ssh session and then log out from this one and then check again. Trouble is, your current session is using pts/0, together with whatever was left from an older session, and that is a bit confusing...

Also, I'd want to check out what the parent process of the 'leftover -ksh' process is.

# ps -ef|grep 421946


HTH,

p5wizard
 
It would be neat if you use this:

ps -ft pts/0 | grep -v grep

then use the PID as:

ps -ef |grep 688328 | grep -v grep

from the output above it seems that pts/0 is having two korn shells

it seems that what you viewed is having only a login session with no subprocesses which is easy to get rid off using this:

kill 688328

then try the command again to make sure that it is killed:
ps -ft pts/0 | grep -v grep

otherwise, use kill -9 688328 (which is not advicable by the way but it does the job!)

Good luck

regards
Khalid
 
p5wizard & Khalid

Guys, thanks for the "ps -ft pts/0" tip. was looking for exactly that.

great forum

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top