diff --git a/server/lib/classes/system.inc.php b/server/lib/classes/system.inc.php index 7e4e7ae447c64bbac3c6a3049d6fafc21ed1a56b..15098b80c0633aaf9ee4d25a193df685a9a71ca2 100644 --- a/server/lib/classes/system.inc.php +++ b/server/lib/classes/system.inc.php @@ -2327,6 +2327,16 @@ class system{ return true; } + public function is_redhat_os() { + global $app; + + if(file_exists('/etc/redhat-release') && (filesize('/etc/redhat-release') > 0)) { + return true; + } else { + return false; + } + } + public function is_allowed_path($path) { global $app; diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index 1a4b3336dab8902b0f06126a30a2b699d4d4813d..78144e7bfbfe904d5d1e69bfea8043a5761a8119 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -2852,7 +2852,6 @@ class nginx_plugin { private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name, $socket_dir, $web_folder = null) { global $app, $conf; $pool_dir = trim($pool_dir); - $rh_releasefiles = array('/etc/centos-release', '/etc/redhat-release'); // HHVM => PHP-FPM-Fallback $default_php_fpm = true; @@ -2923,21 +2922,14 @@ class nginx_plugin { $tpl->setVar('fpm_port', $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1); $tpl->setVar('fpm_user', $data['new']['system_user']); - //Red Hat workaround for group ownership of socket files - foreach($rh_releasefiles as $rh_file) { - if(file_exists($rh_file) && (filesize($rh_file) > 0)) { - $tmp = file_get_contents($rh_file); - if(preg_match('/[678]+\.[0-9]+/m', $tmp)) { - $tpl->setVar('fpm_group', $data['new']['system_group']); - $tpl->setVar('fpm_listen_group', $data['new']['system_group']); - } - unset($tmp); - } elseif(!file_exists($rh_file)) { - //OS seems to be not Red Hat'ish - $tpl->setVar('fpm_group', $data['new']['system_group']); - $tpl->setVar('fpm_listen_group', $web_config['group']); - } - break; + // RH workaround here + if($app->system->is_redhat_os() == true) { + $tpl->setVar('fpm_group', $data['new']['system_group']); + $tpl->setVar('fpm_listen_group', $data['new']['system_group']); + } else { + //OS seems to be not Red Hat'ish + $tpl->setVar('fpm_group', $data['new']['system_group']); + $tpl->setVar('fpm_listen_group', $web_config['group']); } $tpl->setVar('fpm_listen_user', $data['new']['system_user']);