LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   pts + kill problems (https://www.linuxquestions.org/questions/linux-general-1/pts-kill-problems-6514/)

cereal 09-13-2001 07:57 PM

pts + kill problems
 
Hello,

I have a problem of killing or closing a login session. Its kind of hard to kill it, since its not showing on the pid list or anything.

Its "showed" 3 places:
* finger: cereal Aleks *pts/9 Aug 7 15:47 (host.name)
* w: one of the 9 users current users.
* users: one of the users displayed.

I have had several of these zombie-pts but they are supposed to be removed by the kernel right ?

Its not in /dev/pts

btw: Its slack 7.2

Anyone knows how i get this out of the system without rebooting ? its kind of irritating ! :) :confused:


jharris 09-14-2001 04:23 AM

I'm confused - you have a process that you are trying to kill, thats a login shell that doesn't showup when you do a
Code:

ps -ef | more
???

cheers

Jamie...

cereal 09-14-2001 03:01 PM

Hey,

Quote:

ps -ef | more
does not list the pid of the login/pts

The thing is that i want that "login session" to be removed from the stats when running "w" , "finger" and "users"

Its a login i cant kill. Its some file or something i need to remove i think.

Its not on the ps list. Its a zombie without a ID.

What does the star mean in this anyways?

cereal Aleksander *pts/9 Aug 7 15:47 (host.name)

its allso printing when running "finger" :
finger: /dev//pts/9: No such file or directory
finger: /dev//pts/14: No such file or directory
finger: /dev//pts/27: No such file or directory

jharris 09-15-2001 07:20 AM

Uhm... I don't understand - you want to kill off a login shell yeah?? Thats the only way to stop a logged in use showing in the output of finger or w or whatever, mind you this will often kill all the processes that a user is running.

And yeah, ps -ef should show everything, observe, getty's waiting for logins, and my bash login shell as root:
Code:

root      198    1  0 Aug21 tty1    00:00:00 [agetty]
root      199    1  0 Aug21 tty2    00:00:00 [agetty]
root      200    1  0 Aug21 tty3    00:00:00 [agetty]
root    20178 20176  0 12:32 ttyp0    00:00:00 -bash
root    20339 20178  0 13:13 ttyp0    00:00:00 ps -ef
root    20340 20178  0 13:13 ttyp0    00:00:00 -bash

As for Zombie's - a zombie has a PID as every processes must have one!! A zombie is just a process that has been killed, its just waiting around while some resources clean up before its removed by the kernel, hence the name - its not alive, but its still hanging around.

If you are getting errors about /dev/ it normally means you have special files that point to things that don't exist. Have you got "Unix98 PTY Support" in your kernel???

What have I misunderstood???

cheers

Jamie...

cereal 09-15-2001 09:50 AM

hey, thanks :P

But its not that simple. I know how to kill / find pids in the system.

I have asked 50 ppl soon, and the best answar i got was:

Quote:

ex: skill -KILL pts/*
for the pts to show in the pid list it should allso be showed in /dev/pts .

I heard it could be something wrong with lastlogin og wtmp, and their the reson i get this "zombies". Its wrong to call them that, buts that what it is. Its a thing not living but is showed.

Where does all programs get the info about this ?
It has to be a proc file? I wont reboot! :)

U see what i mean now? Its _NOT_ on the pid list, so i cant kill it with any pid nr. Its something in a file or something.

Thanks! ;)

jharris 09-15-2001 11:14 AM

Now I get ya!!

Yeah - I'd agree that is may be a problem with wtmp. Try erasing and recreating it if you want, I think it's probably best to kick any users off the system first though. You should just be able to use
Code:

rm wtmp && touch wtmp && chmod 644
I've only ever bother to clear my wtmp file once and didn't get any hassles, mind you I can't say I've investigated any potential problems it can cause.

As for the star (in an earlier post) - I would *guess* that was your point of login, so the pts is linked to a login shell, not just a shell spawned later in the session. (Linux differentiates between the two)

cheers

Jamie...

rvilarl 10-28-2003 12:05 PM

Hi,

I had the same problem and solved it removing /var/run/utmp and creating a new one as root, that is:

cd /var/run
rm utmp
touch utmp
chgrp utmp utmp
chmod g+w utmp

after that, if you execute who, no user will be shown, but they will be updated on the next login.

Hope it helps...


All times are GMT -5. The time now is 09:21 AM.