From ed7ede063089ae94c3a9832fd511e0850cbb7596 Mon Sep 17 00:00:00 2001 From: Falko Timme Date: Wed, 30 Apr 2014 13:35:35 +0200 Subject: [PATCH] - nginx: do a syntax check because on some distributions, the init script always returns 0 - even if the syntax is not ok (how stupid is that?) --- server/mods-available/web_module.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/mods-available/web_module.inc.php b/server/mods-available/web_module.inc.php index c31aa6711..a403b91cf 100644 --- a/server/mods-available/web_module.inc.php +++ b/server/mods-available/web_module.inc.php @@ -217,6 +217,11 @@ class web_module { } else { exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']); } + + // nginx: do a syntax check because on some distributions, the init script always returns 0 - even if the syntax is not ok (how stupid is that?) + if($web_config['server_type'] == 'nginx' && $retval['retval'] == 0 && is_executable('/usr/sbin/nginx')){ + exec('/usr/sbin/nginx -t 2>&1', $retval['output'], $retval['retval']); + } return $retval; } -- GitLab