From 355feb42f059ae1da0dd9982d981da57d7d87048 Mon Sep 17 00:00:00 2001 From: Till Brehm Date: Sat, 15 Feb 2014 10:00:24 +0100 Subject: [PATCH] Fixed: FS#3278 - Semaphore processes httpd rescue --- server/mods-available/rescue_core_module.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/mods-available/rescue_core_module.inc.php b/server/mods-available/rescue_core_module.inc.php index a3a5ad709..ca69a91f6 100644 --- a/server/mods-available/rescue_core_module.inc.php +++ b/server/mods-available/rescue_core_module.inc.php @@ -272,6 +272,17 @@ class rescue_core_module { /* Set the new try counter */ $this->_rescueData['webserver']['try_counter'] = $tryCount; + + if ($tryCount > 2 && $conf['serverconfig']['web']['server_type'] != 'nginx') { + if($app->system->is_user('apache')) { + $app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN); + exec("ipcs -s | grep apache | awk '{ print $2 }' | xargs ipcrm sem"); + } + if($app->system->is_user('www-data')) { + $app->log("Clearing semaphores table for user apache.",LOGLEVEL_WARN); + exec("ipcs -s | grep www-data | awk '{ print $2 }' | xargs ipcrm sem"); + } + } /* if 5 times will not work, we have to give up... */ if ($tryCount > 5){ -- GitLab