function hostingService_http_apache_ssl::default_restart_cmd in Hosting 7.3
Same name and namespace in other branches
- 6.2 web_server/ssl/hosting_ssl.service.inc \hostingService_http_apache_ssl::default_restart_cmd()
- 7.4 web_server/ssl/hosting_ssl.service.inc \hostingService_http_apache_ssl::default_restart_cmd()
Overrides hostingService::default_restart_cmd
File
- web_server/
ssl/ hosting_ssl.service.inc, line 90 - Define Hosting service class for SSL.
Class
Code
function default_restart_cmd() {
$command = '/usr/sbin/apachectl';
# a proper default for most of the world
foreach (explode(':', $_SERVER['PATH']) as $path) {
$options[] = "{$path}/apache2ctl";
$options[] = "{$path}/apachectl";
}
# try to detect the apache restart command
$options[] = '/usr/local/sbin/apachectl';
# freebsd
$options[] = '/usr/sbin/apache2ctl';
# debian + apache2
$options[] = $command;
foreach ($options as $test) {
if (is_executable($test)) {
$command = $test;
break;
}
}
return "sudo {$command} graceful";
}