1834586 Members
3935 Online
110069 Solutions
New Discussion

who -u

 
SOLVED
Go to solution
j773303
Super Advisor

who -u

How to kill the process which
show by who-u. I use kill -9 process_id, but the message will show process_id is not exist.
Hero
4 REPLIES 4
twang
Honored Contributor

Re: who -u

3 steps to kill the process:
1. "who -u" to find out who you want to kill:
$ who -u
dba pts/0 Jun 5 09:33 1:10 6749 192.168.0.122

2. "ps -ef |grep sh" to find out which sh process associated with the pts/0:
$ ps -ef |grep sh
dba 6749 6747 0 09:33:33 pts/0 0:00 -sh
3. you may now kill the sh process 6749:
$ kill -9 6749
Michael Tully
Honored Contributor
Solution

Re: who -u

You most likely have a corrupted entry in your /etc/utmp file.

Convert the file to ascii
#/usr/sbin/acct/fwtmp < /etc/utmp >/tmp/file
edit the file and remove the corresponding entry for that user and his corresponding tty.

Then can convert it back to binary form:
# /usr/sbin/acct/fwtmp -ic < /tmp/file > /etc/utmp

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"


Anyone for a Mutiny ?
Jeff Schussele
Honored Contributor

Re: who -u

All that means is that by the time you issued the kill command the process had ended.

BTW - kill -9 should ONLY be used IF a normal kill....
kill PID
or
kill -15 PID
have no effect.
kill -9 can leave unreturned memory, msg or semaphore entries that will not be reaped w/o intervention.
MORAL: kill cleanly or silently or don't kill at all.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Snop Hsieh
Occasional Advisor

Re: who -u

Hi.
You can use "ps -t pts/0" to see what the user's running processes,and kill the process id by kill -9.

Regards

snop