Operating System - HP-UX
1835411 Members
2856 Online
110078 Solutions
New Discussion

Zombie session monitoring and usage on one particular account

 
Ghazanfar Sheikh
Occasional Contributor

Zombie session monitoring and usage on one particular account

1) I am trying to find out the usage on one particular account for the last about 10/15 days in a file system. where I go an check?


2) How I can find all the zombie session running on a machine? and what is the best way to prvent this from happening other then manually checking and killing them? Any particaular command syntax / script which I can put in a crobtab?

I appreciate your help in advance.

GS
4 REPLIES 4
BONNAFOUS Jean Marc
Trusted Contributor

Re: Zombie session monitoring and usage on one particular account

Hi,

2) ps -ef|grep defunct|grep -v grep give you all zombie process.

For killing all these zombies:

for PROCESS in `ps -ef|grep defunct|grep -v grep |cut -d" " -f`
do
kill $PROCESS
done

Problem: the number of PID column depend on the output of ps -ef command. It's 2 or 3.

Rgds
JMB


Si vous ne faites jamais de bétises, c'est que vous ne faites rien de difficile. Et ça c'est une grosse bétise.
A. Clay Stephenson
Acclaimed Contributor

Re: Zombie session monitoring and usage on one particular account

By definition, any defunct process is already dead and can't be killed. In UNIX speak, these processes can't respond to a signal. Kill's (yes, even kill -9's) are a waste of time for these processes. Kill is a misnomer and should have really been named 'signal', 'hint', 'request', ... -- but that time is long past.


The real solution to your problem is to not create zombie's in the first place. A very common cause is improper termination of sessions especially when connected to PC client software.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Zombie session monitoring and usage on one particular account

The last command will at least give you the login times on a particular account.

last -R | grep username

For more detailed reporting you may want to make your system trusted and fine tune the audit reports and data collection to provide the details you desire.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ghazanfar Sheikh
Occasional Contributor

Re: Zombie session monitoring and usage on one particular account

Thanks for your help.

Regards,
GS