Skip to content

Commit 355feb4

Browse files
author
Till Brehm
committed
Fixed: FS#3278 - Semaphore processes httpd rescue
1 parent 91bb612 commit 355feb4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

server/mods-available/rescue_core_module.inc.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,17 @@ private function _rescueHttpd(){
272272

273273
/* Set the new try counter */
274274
$this->_rescueData['webserver']['try_counter'] = $tryCount;
275+
276+
if ($tryCount > 2 && $conf['serverconfig']['web']['server_type'] != 'nginx') {
277+
if($app->system->is_user('apache')) {
278+
$app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN);
279+
exec("ipcs -s | grep apache | awk '{ print $2 }' | xargs ipcrm sem");
280+
}
281+
if($app->system->is_user('www-data')) {
282+
$app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN);
283+
exec("ipcs -s | grep www-data | awk '{ print $2 }' | xargs ipcrm sem");
284+
}
285+
}
275286

276287
/* if 5 times will not work, we have to give up... */
277288
if ($tryCount > 5){

0 commit comments

Comments
 (0)