Run away processes

Hi,

My server runnning on SUN Solaris rel.5.5.1. I have been facing this issues for years. I have some Xbase databases running on the server. User is using emulation software to telnet to server for accessing application. If user logout application abnormally - by closing windows session, then it will become a run away process. And if user login system again, there will be 2 user login if you issue who command, and if you use ps -ef, and it will also show 2 process existed, both also active. But from ps -ef, or from ps -u, there will be 2 different process existed, and in fact there is only active, the earlier process is considered ran away and can be killed off. Those ran away processes, you will realised that the time will keep growing and it will create unnecessary load and slow down the system.

In normal circumstances, the system will only show 1 active user and processes may be have 2, so that i will know which is the active one and I can kill it off, but now our SunOS seems like having some problem in identifying.

Is there a command to show that which are the active process so that I can kill it off safely. Would appreciate any comment or advise from you.

Thank you and have a nice day.

Regards
T.W.Low

is there a way to tell the difference between a rnuaway process and one that is legitimate?

we have another server running the same OS which do not have this problem.

Below is the scenerio,

root # who |grep bwopn1
bwopn1 pts/27 Feb 16 08:18 (10.3.1.251)
bwopn1 pts/153 Feb 16 09:03 (10.3.1.251)
bwopn1 pts/163 Feb 16 09:07 (10.3.1.251)

root # ps -ef |grep db |grep bwopn1
bwopn1 3818 3811 2 08:18:11 pts/27 6:35 /u/recital/db.exe -x tntbw
bwopn1 6691 6652 0 09:07:08 pts/163 0:01 /u/recital/db.exe -x tntbw
bwopn1 6321 6304 0 09:03:24 pts/153 0:02 /u/recital/db.exe -x tntbw

from here you will see that the session login at 8:18, it's probably inactive due to user accidentally close the screen.

If under normal circumstances, when you do a who, it should show 2 active users only, but the ps -ef will still show 3 session, at least from who will tell there are only 2 active users.

Is there any command that can output that only inactive or active session ?

Thanks & Rgds
T.W.Low