Operating System - HP-UX
1833163 Members
3079 Online
110051 Solutions
New Discussion

Re: Killing the idle HP Unix Process

 
Pranab
New Member

Killing the idle HP Unix Process

Is there any script which kill the idle or deadlock process after each and every hours in HP unix.
Please inform me.
5 REPLIES 5
Tim D Fulford
Honored Contributor

Re: Killing the idle HP Unix Process

I dont know of a script to do this... but I would be very careful about how you define idle. some processes use very little CPU, but are crucial.

If a process is idle, then it is consuming very little/no CPU, thus is not too much of a problem (or resource hog). You really should be looking for greedy processes, or zombie processes.

Regards

Tim
-
James R. Ferguson
Acclaimed Contributor

Re: Killing the idle HP Unix Process

Hi:

If you mean a user's login shell, then you can set the 'TMOUT' variable to a non-zero value of seconds. The passage of this number of seconds from the last 'PS1' shell prompt will result in termination.

Set the TMOUT variable in the user's login profile.

Regards!

...JRF...
IT_2007
Honored Contributor

Re: Killing the idle HP Unix Process

You should check for zombie processes not idle because you may end up killing unwanted processes and which may shutdown/reboot server.
Jonathan Fife
Honored Contributor

Re: Killing the idle HP Unix Process

We have scripts that kill long-running instances of SPECIFIC processes, but anything that wantonly kills processes based on start-time is going to be pretty dangerous to server stability.
Decay is inherent in all compounded things. Strive on with diligence
Bill Hassell
Honored Contributor

Re: Killing the idle HP Unix Process

There is no such script or tool to do this because it will always be wrong and kill something important. You have to make several decisions about each process such as:

1. Is the process a parent to a running process? Killing the parent will likely kill the child too.

2. How do I know the process is idle? A network daemon or other program waiting on a remote event may appear to be idle for a long time.

3. Do other porcesses depend on the process I am going to kill?

These are decisions that are quite difficult to make with a script. You repair processes that are deadlocked (rewrite the code so it works properly) and define exactly what processes are really idle. Or you eliminate logins for inexperienced users and give them a menu that handles idle time by exiting.


Bill Hassell, sysadmin