Operating System - HP-UX
1752866 Members
4023 Online
108791 Solutions
New Discussion

Re: kill all the process of a particular user

 
MAUCCI_2
Frequent Advisor

Re: kill all the process of a particular user

Armin's solution is the one I have been using for years and is the best looking to me ;-)

++Cyrille
Bill Hassell
Honored Contributor

Re: kill all the process of a particular user

Be very, very careful with kill -9. It should never be used to terminate any processes unless absolutely necessary. kill -9 leaves temporary files, orphaned shared memory segments, semaphores out of synce, databases corrupted, etc. The best way to kill a user's session is to determine the parent process and use kill -15 (also known as kill -SIGTERM or kill -TERM).

To determine all the user's sessions, you can use the -H option to ps as in:

UNIX95= ps -fHu user_name

Then you only need to kill the top level process and the rest of the processes should terminate normally.


Bill Hassell, sysadmin