Commit dda2b474 authored by Marius Burkard's avatar Marius Burkard

Renewal of letsencrypt does not restart/reload nginx, fixes #5033

parent e6bd0a7d
......@@ -69,9 +69,10 @@ $conf['server_id'] = intval($conf['server_id']);
// Load required base-classes
$app->uses('ini_parser,file,services,getconf,system,cron,functions');
$app->uses('modules,ini_parser,file,services,getconf,system,cron,functions');
$app->load('libdatetime,cronjob');
$app->modules->loadModules('web');
// read all cron jobs
$path = SCRIPT_PATH . '/lib/classes/cron.d';
......@@ -114,6 +115,8 @@ foreach($files as $f) {
}
unset($files);
$app->services->processDelayedActions();
// Remove lock
@unlink($conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock');
$app->log('Remove Lock: ' . $conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock', LOGLEVEL_DEBUG);
......
......@@ -37,18 +37,32 @@ class modules {
/*
This function is called to load the modules from the mods-enabled or the mods-core folder
*/
function loadModules($type) {
function loadModules($type = 'all') {
global $app, $conf;
$subPath = 'mods-enabled';
if ($type == 'core') $subPath = 'mods-core';
if ($type == 'core') {
$subPath = 'mods-core';
} elseif ($type == 'all') {
$type = '';
} elseif (!preg_match('/^\w+$/', $type)) {
$app->log('Invalid loadModules type ' . $type, LOGLEVEL_ERROR);
return false;
} else {
$subPath = 'mods-available';
}
$loaded = false;
$modules_dir = $conf['rootpath'].$conf['fs_div'].$subPath.$conf['fs_div'];
if (is_dir($modules_dir)) {
if ($dh = opendir($modules_dir)) {
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..' && substr($file, -8, 8) == '.inc.php') {
$module_name = substr($file, 0, -8);
if($type && $type !== 'core' && $type != $module_name) {
continue;
}
$loaded = true;
include_once $modules_dir.$file;
if($this->debug) $app->log('Loading Module: '.$module_name, LOGLEVEL_DEBUG);
$app->loaded_modules[$module_name] = new $module_name;
......@@ -60,6 +74,9 @@ class modules {
$app->log('Modules directory missing: '.$modules_dir, LOGLEVEL_ERROR);
}
if($type && $type !== 'core' && $loaded === false) {
$app->log('Module ' . $type . ' not found.', LOGLEVEL_ERROR);
}
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment