Operating System - HP-UX
1847817 Members
5232 Online
104021 Solutions
New Discussion

how remove "old" session in HP-UX 10.20

 
SOLVED
Go to solution
Mauro Gatti
Valued Contributor

how remove "old" session in HP-UX 10.20

Using command "who -u" i get some lines like this:
emanc ttypc May 4 09:53 old 19333 194.63.3.172

but if i look for "ps -u emanc" i don't find any process associated to this users.

How can i eliminate this "old" session?

Thank You
Ubi maior, minor cessat!
6 REPLIES 6
Jose Martinez Rodriguez
Honored Contributor

Re: how remove "old" session in HP-UX 10.20

Hi,

You can try to kill all the process associated to the terminal ttypc. So, you must run the command:

ps -ef | grep ttypc

and kill all the process associated with ttypc. Then, the session must be close.
Pedro Sousa
Honored Contributor

Re: how remove "old" session in HP-UX 10.20

Hi Mauro,
the easiest way is to kill the process that appears with the "who -u" command.
in this particular case you would just need to "kill 19333"
good luck.
Mauro Gatti
Valued Contributor

Re: how remove "old" session in HP-UX 10.20

I've already tried this solutions :-)
The ttypc don't have any process active...
the process 19333 doesn't exist!!!!
(kill -9 19333 returns :"kill: 19333: no such process")
This user is like a zombie :-)!!!


Ubi maior, minor cessat!

Re: how remove "old" session in HP-UX 10.20

"who" gets its data from /etc/utmp which is "administered" by getty (I think). The reason of your "zombie user" could be an abnormally terminated connection or something similar. For "removing" this user I know two possibilities:
1. "edit" the file /etc/utmp, and change the entry of your "zombie user" (it is a binary file, but it has a well defined structure, so you can write a short c-program to read/change the entries, or you can download it from several sites)
2. move/remove/"truncate" the file /etc/utmp. This will have effect on other users' login data, so this isn't the best solution. But if you (root) are the only user logged in, then it should work.


Laszlo
Mauro Gatti
Valued Contributor

Re: how remove "old" session in HP-UX 10.20

How this "zombie" proces is created?
Why?

Where i could find a program that clean my system?
Ubi maior, minor cessat!
Wieslaw Krajewski
Honored Contributor
Solution

Re: how remove "old" session in HP-UX 10.20

Hi,

Try to do as follows:

1. /usr/sbin/acct/fwtmp < /etc/utmp >/temporary_file

2. vi /temporary_file
and remove old unnecessary login info

3. /usr/sbin/acct/fwtmp -ic < /temporary_file > /etc/utmp

Of course you can use sed or awk instead vi.

I do not remember at the moment if you need to do the same with /var/adm/wtmp file. Must check.

Hope this helps.

Rgds.
Permanent training makes master