Skip to content

Commit dda2b47

Browse files
author
Marius Burkard
committed
Renewal of letsencrypt does not restart/reload nginx, fixes #5033
1 parent e6bd0a7 commit dda2b47

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

server/cron.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@
6969

7070

7171
// Load required base-classes
72-
$app->uses('ini_parser,file,services,getconf,system,cron,functions');
72+
$app->uses('modules,ini_parser,file,services,getconf,system,cron,functions');
7373
$app->load('libdatetime,cronjob');
7474

75+
$app->modules->loadModules('web');
7576

7677
// read all cron jobs
7778
$path = SCRIPT_PATH . '/lib/classes/cron.d';
@@ -114,6 +115,8 @@
114115
}
115116
unset($files);
116117

118+
$app->services->processDelayedActions();
119+
117120
// Remove lock
118121
@unlink($conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock');
119122
$app->log('Remove Lock: ' . $conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock', LOGLEVEL_DEBUG);

server/lib/classes/modules.inc.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,32 @@ class modules {
3737
/*
3838
This function is called to load the modules from the mods-enabled or the mods-core folder
3939
*/
40-
function loadModules($type) {
40+
function loadModules($type = 'all') {
4141
global $app, $conf;
4242

4343
$subPath = 'mods-enabled';
44-
if ($type == 'core') $subPath = 'mods-core';
44+
if ($type == 'core') {
45+
$subPath = 'mods-core';
46+
} elseif ($type == 'all') {
47+
$type = '';
48+
} elseif (!preg_match('/^\w+$/', $type)) {
49+
$app->log('Invalid loadModules type ' . $type, LOGLEVEL_ERROR);
50+
return false;
51+
} else {
52+
$subPath = 'mods-available';
53+
}
4554

55+
$loaded = false;
4656
$modules_dir = $conf['rootpath'].$conf['fs_div'].$subPath.$conf['fs_div'];
4757
if (is_dir($modules_dir)) {
4858
if ($dh = opendir($modules_dir)) {
4959
while (($file = readdir($dh)) !== false) {
5060
if($file != '.' && $file != '..' && substr($file, -8, 8) == '.inc.php') {
5161
$module_name = substr($file, 0, -8);
62+
if($type && $type !== 'core' && $type != $module_name) {
63+
continue;
64+
}
65+
$loaded = true;
5266
include_once $modules_dir.$file;
5367
if($this->debug) $app->log('Loading Module: '.$module_name, LOGLEVEL_DEBUG);
5468
$app->loaded_modules[$module_name] = new $module_name;
@@ -60,6 +74,9 @@ function loadModules($type) {
6074
$app->log('Modules directory missing: '.$modules_dir, LOGLEVEL_ERROR);
6175
}
6276

77+
if($type && $type !== 'core' && $loaded === false) {
78+
$app->log('Module ' . $type . ' not found.', LOGLEVEL_ERROR);
79+
}
6380
}
6481

6582
/*

0 commit comments

Comments
 (0)