Activities

July 2014
M T W T F S S
« Jun   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

How do I terminate all the user process

One the user account in a Cpanel account showing errors “fork: Unable to fork new process” while the user is try to access his shell.

it’s because there would be set a shell session limit for each users in Whm/Cpanel account. on my scenario, it uses suphp in Apache settings and apache uses user credentials to run the application. Mistakenly the devops team set a cronjob wrongly which causes many duplicate script have been executed from shell simultaneously which causes process hogging.

Solution :

How do I count all the active user sessions

root@cc1606 #ps aux | grep  username

Terminate all the process which that user initiated from the system memory.

Eg : for i in `ps aux | grep username | awk ‘{print $2}’`; do kill -9 $i; done

root@cc1606 #for i in `ps aux | grep  liju_user  | awk '{print $2}'`; do kill -9 $i; done

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>