Skip to content

Commit 5e807fd

Browse files
author
Marius Burkard
committed
Merge remote-tracking branch 'ispc3/stable-3.1' into rspamd
2 parents 0d8f89b + ab82c4d commit 5e807fd

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

server/conf/vhost.conf.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215
<tmpl_if name='cgi' op='==' value='y'>
216216
# cgi enabled
217217
<Directory {tmpl_var name='document_root'}/cgi-bin>
218+
AllowOverride <tmpl_var name='allow_override'>
218219
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
219220
Require all granted
220221
<tmpl_else>

server/cron.php

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,33 @@
3333

3434
// Check whether another instance of this script is already running
3535
$lockFile = $conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock';
36-
if (is_file($lockFile)) {
36+
if(is_file($lockFile)) {
3737
clearstatcache();
38-
39-
// Maybe we hit a deadlock and the lock file is no longer relevant
40-
if(filemtime($lockFile) > time() - 86400) { // 86400 seconds = 1 day
41-
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - The cron lock file is older than one day.' . "\n";
42-
exit;
43-
}
44-
45-
// Check if the process id we have in the lock file is still present
38+
39+
// Check if the process id we have in the lock file is still present
4640
$pid = trim(file_get_contents($lockFile));
4741
if(preg_match('/^[0-9]+$/', $pid)) {
48-
if(file_exists('/proc/' . $pid)) {
49-
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already an instance of server.php running with pid ' . $pid . '.' . "\n";
50-
exit;
42+
if(is_dir('/proc/' . $pid)) {
43+
if(file_exists('/proc/' . $pid . '/cmdline')) {
44+
if(strpos(file_get_contents('/proc/' . $pid . '/cmdline'), 'cron.php') !== false) {
45+
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already an instance of cron.php running with pid ' . $pid . '.' . "\n";
46+
exit;
47+
} else {
48+
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is a process running with pid ' . $pid . ' but it seems not to be cron.php, continuing.' . "\n";
49+
}
50+
} else {
51+
if(filemtime($lockFile) < time() - 86400) {
52+
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already an instance of cron.php running with pid ' . $pid . ' but process is older than 1 day. Continuing.' . "\n";
53+
} else {
54+
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already an instance of cron.php running with pid ' . $pid . '.' . "\n";
55+
exit;
56+
}
57+
}
58+
} else {
59+
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already a lockfile set, but no process running with this pid (' . $pid . '). Continuing.' . "\n";
60+
5161
}
5262
}
53-
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already a lockfile set, but no process running with this pid (' . $pid . '). Continuing.' . "\n";
5463
}
5564

5665
// Set Lockfile
@@ -69,7 +78,7 @@
6978

7079

7180
// Load required base-classes
72-
$app->uses('modules,ini_parser,file,services,getconf,system,cron,functions');
81+
$app->uses('modules,ini_parser,file,services,getconf,system,cron,functions,plugins');
7382
$app->load('libdatetime,cronjob');
7483

7584
// read all cron jobs

server/lib/classes/monitor_tools.inc.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,21 +217,18 @@ function get_distname() {
217217
$distconfid = 'debian100';
218218
$distid = 'debian60';
219219
$distbaseid = 'debian';
220-
swriteln("Operating System: Debian 10.0 (Buster) or compatible\n");
221220
} elseif(strstr(trim(file_get_contents('/etc/debian_version')), '/sid')) {
222221
$distname = 'Debian';
223222
$distver = 'Testing';
224223
$distid = 'debian60';
225224
$distconfid = 'debiantesting';
226225
$distbaseid = 'debian';
227-
swriteln("Operating System: Debian Testing\n");
228226
} else {
229227
$distname = 'Debian';
230228
$distver = 'Unknown';
231229
$distid = 'debian60';
232230
$distconfid = 'debian100';
233231
$distbaseid = 'debian';
234-
swriteln("Operating System: Debian or compatible, unknown version.\n");
235232
}
236233
}
237234

0 commit comments

Comments
 (0)