#!/bin/sh
for ROUND in `ps aux | grep roundcube | awk -F " " '{print $10}' | awk -F ":" '{print $1}'`;
do
if [ $ROUND -ge 20 ]; then
pkill -u cpanelroundcube
echo "kill roundcube process roundcube";
fi
done
Try reading this forum. We've been using this suggestion...Today, 1 of my cPanel servers nearly crashed. The load went upto 60 - 100. After more than 1 hour, I can finally login into server, kill all service and wait until the load went down. I found out that it was caused by cpanelro. too many process from this cpanelro. i run a latest build, cPanel 11.24.5-R37127 - WHM 11.24.2 - X 3.9
Anyone here knows how to avoid this in future ? Is there any security problem with Roundcube ? even i run on latest cPanel built?
Thanks
function iil_C_Login(&$conn, $user, $password) {
iil_PutLine($conn->fp, 'a001 LOGIN "'.iil_Escape($user).'" "'.iil_Escape($password).'"');
$counter = 0;
do {
$line = iil_ReadReply($conn->fp);
if ($line === false) {
break;
}else if($counter > 0){
break;
}
$counter = $counter + 1;
} while (!iil_StartsWith($line, 'a001 ', true));
// process result
$result = iil_ParseResult($line);
if ($result == 0) {
$conn->error .= '';
$conn->errorNum = 0;
return $conn->fp;
}
fclose($conn->fp);
$conn->error .= 'Authentication for ' . $user . ' failed (LOGIN): "';
$conn->error .= htmlspecialchars($line)."\"";
$conn->errorNum = $result;
return $result;
}
function iil_ParseResult($string) {
$a = explode(' ', $string);
if (count($a) > 2) {
if (strcasecmp($a[1], 'OK') == 0) {
return 0;
} else if (strcasecmp($a[1], 'NO') == 0) {
return -1;
} else if (strcasecmp($a[1], 'BAD') == 0) {
return -2;
} else if (strcasecmp($a[1], 'BYE') == 0) {
return -3;
}
}else if(!$string){
return -1;
}
return -4;
}
What do you name this script. I tried calling it roudcubefix.sh, but I cannot execute it. Says file not found.Run thise every 30 minutes for root cron, will automaticaly chceck roundcube process if hang kill processon my server fixed problem
on Centos 4.x and Centos 5.x
Code:#!/bin/sh for ROUND in `ps aux | grep roundcube | awk -F " " '{print $10}' | awk -F ":" '{print $1}'`; do if [ $ROUND -ge 20 ]; then pkill -u cpanelroundcube echo "kill roundcube process roundcube"; fi done