reload fpm before nginx

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-09 11:51:43 +01:00
parent 3d647a2c2e
commit d381528c06

View File

@@ -63,16 +63,7 @@ class nginx extends HttpConfigBase
public function reload() public function reload()
{ {
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: reloading nginx'); if ((int) Settings::Get('phpfpm.enabled') == 1) {
safe_exec(Settings::Get('system.apachereload_command'));
/**
* nginx does not auto-spawn fcgi-processes
*/
if (Settings::Get('system.phpreload_command') != '' && (int) Settings::Get('phpfpm.enabled') == 0) {
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: restarting php processes');
safe_exec(Settings::Get('system.phpreload_command'));
} elseif ((int) Settings::Get('phpfpm.enabled') == 1) {
// get all start/stop commands // get all start/stop commands
$startstop_sel = Database::prepare("SELECT reload_cmd, config_dir FROM `" . TABLE_PANEL_FPMDAEMONS . "`"); $startstop_sel = Database::prepare("SELECT reload_cmd, config_dir FROM `" . TABLE_PANEL_FPMDAEMONS . "`");
Database::pexecute($startstop_sel); Database::pexecute($startstop_sel);
@@ -90,6 +81,17 @@ class nginx extends HttpConfigBase
safe_exec(escapeshellcmd($restart_cmd['reload_cmd'])); safe_exec(escapeshellcmd($restart_cmd['reload_cmd']));
} }
} }
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: reloading nginx');
safe_exec(Settings::Get('system.apachereload_command'));
/**
* nginx does not auto-spawn fcgi-processes
*/
if (Settings::Get('system.phpreload_command') != '' && (int) Settings::Get('phpfpm.enabled') == 0) {
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: restarting php processes');
safe_exec(Settings::Get('system.phpreload_command'));
}
} }
/** /**