Skip to content

Commit ed7ede0

Browse files
committed
- 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?)
1 parent b283f9c commit ed7ede0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/mods-available/web_module.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ function restartHttpd($action = 'restart') {
217217
} else {
218218
exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']);
219219
}
220+
221+
// 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?)
222+
if($web_config['server_type'] == 'nginx' && $retval['retval'] == 0 && is_executable('/usr/sbin/nginx')){
223+
exec('/usr/sbin/nginx -t 2>&1', $retval['output'], $retval['retval']);
224+
}
220225
return $retval;
221226
}
222227

0 commit comments

Comments
 (0)