Kill sessions on AIX5.2


 
Thread Tools Search this Thread
Operating Systems AIX Kill sessions on AIX5.2
# 1  
Old 04-24-2012
Kill sessions on AIX5.2

Hi,

I have a problem with a server which doesn't stop some sessions.
It looks a ghost sessions.
I don't have defunct process.
I can't find some processes which are executing with the session t41 and t49...
Every time, I have to reboot the server to stop those sessions...
If someone have some clues to help me... Smilie


Quote:
root@gen0568/home/root> w
root pts/15 11:16 0 0 0 w
t41 pts/17 fri11 4days 0 0 -
t49 pts/20 thu11 5days 0 0 -
root@gen0568/home/root> ps -ef|grep t41
root 98824 40076 0 11:16:44 pts/15 0:00 grep t41
root@gen0568/home/root> ps -ef|grep t49
root 98826 40076 0 11:16:48 pts/15 0:00 grep t49
root@gen0568/home/root> ps -ef|grep "pts/17"
root 108772 40076 0 11:16:58 pts/15 0:00 grep pts/17
root@gen0568/home/root> ps -ef|grep "pts/20"
root 86104 40076 1 11:17:06 pts/15 0:00 grep pts/20
# 2  
Old 04-24-2012
AIX 5.2 is rather old and not supported anymore. Maybe this is a problem related to the OS, sshd or telnetd, whatever these listed logins are related to.
Maybe make sure you go at least to the latest ML that is available for 5.2.
# 3  
Old 04-25-2012
These are just interactive sessions where the user has disconnected untidily. The information is coming from the utmp file. The same file as is used by the who -u command.
A reboot will indeed clear them (because this starts a new utmp file) but they are totally harmless if they are not actually running any processes.
# 4  
Old 04-26-2012
methyl is correct. The "ghost sessions" are just entries in the "/var/adm/utmp" file and could be ignored.

If you still want to clean that up you could try to "zap" the utmp file.

CAUTION: NEVER delete this file! This file is open and you must not delete files opened by processes. The reason is that deleting/recreating the file will give it another inode (you can try that with a temporary file and using ls -i displaying the inode number) and hence make it impossible for the process(es) to find it.

The way to delete open files while preserving their inode is to what i call "zapping": copy the content of "/dev/null" (which contains an End-Of-File marker) to it, reducing the length to zero:

Code:
cat /dev/null > /var/adm/utmp

This might solve your problem without a reboot, but i have no 5.2-system to verify it. You will have to try.

I hope this helps.

bakunin
# 5  
Old 04-26-2012
I think that nulling the utmp file will only make things worse because it will orphan the current logged-in users records. Utilities like uptime would stop working. You can see what's in your utmp file with the fwtmp utility (even though it is intended for the wtmp file).
# 6  
Old 04-27-2012
Quote:
Originally Posted by methyl
I think that nulling the utmp file will only make things worse because it will orphan the current logged-in users records.
You are right. On the other hand as users log out and log in again this will become corrected over time. Depending on how much and which type of (long-lasting or short) user sessions the system typically experiences this may take a tolerable amount of time.

Btw., it is a good idea to temporarily disable logins for safety while working on the utmp file. This can be done by creating an empty file /etc/nologin as root. The simple existence of the file prevents logins, removal of it (which is done automatically at reboot too) will reenable logins.

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Kill an specific process ID using the KILL and GREP commands

Good afternoon I need to KILL a process in a single command sentence, for example: kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'` That sentence Kills the process ID corresponding to the program CAL255.4ge. However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies

2. Shell Programming and Scripting

Kill sessions

Hi , I am connecting to the linux redhat machine as user : APPS I would like to know how i can kill -9 , all APPS sessions beside me . Please advice Thanks (2 Replies)
Discussion started by: yoavbe
2 Replies

3. AIX

Help about identify the SP of my OS (Aix5.3)

Hi, I need to know how can I identify, wich SP is installed in my OS (AIX5.3)? and how can I upgrade it? thanks a lot, (7 Replies)
Discussion started by: fdeivis
7 Replies

4. AIX

smtctl in AIX5.3

Dear Members :), Curently we are migrating our AIX from 5.2.to 5.3, after migration when we check CPU through nmon it shows double in no i.e we have 8 CPU on our p570 box but nmom shows it 16 after investigation it was found that smtctl was enabled in AIX 5.3,can we disable the smtctl & what is... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

5. AIX

How to upgrade AIX5.3TL6-07 to AIX5.3TL8-04?

Hello All, After creating lpp_source/spot from AIX 5.3TL6-07 DVD on the NIM(AIX6.1), I went online and download the fix pack for reaching TL8-04. (it was less than 200Mgegs total) then I did define a newer lpp_source530TL8-04 via a copy from the older lpp_source530TL6-07 (I diduse a command... (2 Replies)
Discussion started by: sangers
2 Replies

6. Linux

Kill a process without using kill command

I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies

7. Shell Programming and Scripting

Kill a process without using kill command

Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies

8. AIX

ssh on AIX5.2

i got this error while installing ssh package time bash-3.00# installp -d /openssh/ openssh.base installp: No action was indicated. The -a (apply) flag is being assumed. +-----------------------------------------------------------------------------+ Pre-installation Verification...... (3 Replies)
Discussion started by: chinni929
3 Replies

9. Programming

kill(0,-9) don't kill the process

Hi all i have simple c program , when i wish to kill the app im using kill(0,-9) , but it seams this command don't do any thing and the program. just ignore it . what im doing wrong here ? im using HP-UX ia64 Thanks (9 Replies)
Discussion started by: umen
9 Replies

10. UNIX for Advanced & Expert Users

When kill doesnt work, how to kill a process ?

Hi All, I am unable to kill a process using kill command. I am using HP-UX system. I have tried with kill -9 and i have root privilages. How can i terminate this daemon ? ? ? Regards, Vijay Hegde (3 Replies)
Discussion started by: VijayHegde
3 Replies
Login or Register to Ask a Question