use the same cron.d-name as in the config-template as the 'default' cronjob is not needed after the first generation of the new one; generate different lockfiles for the different jobs to avoid unnecessary conflicts
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -26,7 +26,7 @@ return array(
|
|||||||
'varname' => 'cronconfig',
|
'varname' => 'cronconfig',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'default' => '/etc/cron.d/froxlor-services',
|
'default' => '/etc/cron.d/froxlor',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_crondreload' => array(
|
'system_crondreload' => array(
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'mdaserver', 'dovecot'),
|
('system', 'mdaserver', 'dovecot'),
|
||||||
('system', 'mtaserver', 'postfix'),
|
('system', 'mtaserver', 'postfix'),
|
||||||
('system', 'mailtraffic_enabled', '1'),
|
('system', 'mailtraffic_enabled', '1'),
|
||||||
('system', 'cronconfig', '/etc/cron.d/froxlor-services'),
|
('system', 'cronconfig', '/etc/cron.d/froxlor'),
|
||||||
('system', 'crondreload', '/etc/init.d/cron reload'),
|
('system', 'crondreload', '/etc/init.d/cron reload'),
|
||||||
('panel', 'decimal_places', '4'),
|
('panel', 'decimal_places', '4'),
|
||||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||||
|
|||||||
@@ -2692,7 +2692,7 @@ if (isFroxlorVersion('0.9.32-dev4')) {
|
|||||||
|
|
||||||
showUpdateStep("Adding new settings for cron");
|
showUpdateStep("Adding new settings for cron");
|
||||||
// get user-chosen value
|
// get user-chosen value
|
||||||
$crondfile = isset($_POST['crondfile']) ? $_POST['crondfile'] : "/etc/cron.d/froxlor-services";
|
$crondfile = isset($_POST['crondfile']) ? $_POST['crondfile'] : "/etc/cron.d/froxlor";
|
||||||
$crondfile = makeCorrectFile($crondfile);
|
$crondfile = makeCorrectFile($crondfile);
|
||||||
Settings::AddNew("system.cronconfig", $crondfile);
|
Settings::AddNew("system.cronconfig", $crondfile);
|
||||||
// add task to generate cron.d-file
|
// add task to generate cron.d-file
|
||||||
|
|||||||
@@ -637,8 +637,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
|
|||||||
if (versionInUpdate($current_version, '0.9.32-dev5')) {
|
if (versionInUpdate($current_version, '0.9.32-dev5')) {
|
||||||
$has_preconfig = true;
|
$has_preconfig = true;
|
||||||
$description = 'Froxlor now generates a cron-configuration file for the cron-daemon. Please set a filename which will be included automatically by your crond (e.g. files in /etc/cron.d/)<br /><br />';
|
$description = 'Froxlor now generates a cron-configuration file for the cron-daemon. Please set a filename which will be included automatically by your crond (e.g. files in /etc/cron.d/)<br /><br />';
|
||||||
$question = '<strong>Path to the cron-service configuration-file.</strong> This file will be updated regularly and automatically by froxlor.<br />Note: Do <b>not</b> use the same filename as for the main froxlor cronjob (/etc/cron.d/froxlor)!<br />';
|
$question = '<strong>Path to the cron-service configuration-file.</strong> This file will be updated regularly and automatically by froxlor.<br />Note: please <b>be sure</b> to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!<br />';
|
||||||
$question.= '<input type="text" class="text" name="crondfile" value="/etc/cron.d/froxlor-services" /><br />';
|
$question.= '<input type="text" class="text" name="crondfile" value="/etc/cron.d/froxlor" /><br />';
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,19 @@ if (function_exists("date_default_timezone_set")
|
|||||||
@date_default_timezone_set(@date_default_timezone_get());
|
@date_default_timezone_set(@date_default_timezone_get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$basename = basename($_SERVER['PHP_SELF'], '.php');
|
||||||
|
if (isset($argv) && is_array($argv) && count($argv) > 1) {
|
||||||
|
for($x=1;$x < count($argv);$x++) {
|
||||||
|
if (substr(strtolower($argv[$x]), 0, 2) == '--'
|
||||||
|
&& strlen($argv[$x]) > 3
|
||||||
|
) {
|
||||||
|
$basename .= "-".substr(strtolower($argv[$x]), 2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$lockdir = '/var/run/';
|
$lockdir = '/var/run/';
|
||||||
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
|
$lockFilename = 'froxlor_' . $basename . '.lock-';
|
||||||
$lockfName = $lockFilename . getmypid();
|
$lockfName = $lockFilename . getmypid();
|
||||||
$lockfile = $lockdir . $lockfName;
|
$lockfile = $lockdir . $lockfName;
|
||||||
|
|
||||||
|
|||||||
@@ -1799,7 +1799,7 @@ $lng['serversettings']['mtalog']['description'] = "Logfile of the Mail Transfer
|
|||||||
$lng['panel']['ftpdesc'] = 'FTP description';
|
$lng['panel']['ftpdesc'] = 'FTP description';
|
||||||
$lng['admin']['cronsettings'] = 'Cronjob settings';
|
$lng['admin']['cronsettings'] = 'Cronjob settings';
|
||||||
$lng['serversettings']['system_cronconfig']['title'] = 'Cron configuration file';
|
$lng['serversettings']['system_cronconfig']['title'] = 'Cron configuration file';
|
||||||
$lng['serversettings']['system_cronconfig']['description'] = 'Path to the cron-service configuration-file. This file will be updated regularly and automatically by froxlor.<br />Note: Do <b>not</b> use the same filename as for the main froxlor cronjob (/etc/cron.d/froxlor)!';
|
$lng['serversettings']['system_cronconfig']['description'] = 'Path to the cron-service configuration-file. This file will be updated regularly and automatically by froxlor.<br />Note: Please <b>be sure</b> to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!';
|
||||||
$lng['tasks']['remove_ftpacc_files'] = 'Delete customer ftp-account data.';
|
$lng['tasks']['remove_ftpacc_files'] = 'Delete customer ftp-account data.';
|
||||||
$lng['tasks']['regenerating_crond'] = 'Rebuilding the cron.d-file';
|
$lng['tasks']['regenerating_crond'] = 'Rebuilding the cron.d-file';
|
||||||
$lng['serversettings']['system_crondreload']['title'] = 'Cron-daemon reload command';
|
$lng['serversettings']['system_crondreload']['title'] = 'Cron-daemon reload command';
|
||||||
|
|||||||
@@ -1525,7 +1525,7 @@ $lng['serversettings']['mtalog']['description'] = "Die Logdatei des Mail Transfe
|
|||||||
$lng['panel']['ftpdesc'] = 'FTP Beschreibung';
|
$lng['panel']['ftpdesc'] = 'FTP Beschreibung';
|
||||||
$lng['admin']['cronsettings'] = 'Cronjob Einstellungen';
|
$lng['admin']['cronsettings'] = 'Cronjob Einstellungen';
|
||||||
$lng['serversettings']['system_cronconfig']['title'] = 'Cron-Konfigurationsdatei';
|
$lng['serversettings']['system_cronconfig']['title'] = 'Cron-Konfigurationsdatei';
|
||||||
$lng['serversettings']['system_cronconfig']['description'] = 'Pfad zur Konfigurationsdatei des Cron-Dienstes. Diese Datei wird von froxlor automatisch aktualisiert.<br />Hinweis: bitte <b>nicht</b> die gleiche Datei wie für den Froxlor-Haupt-Cronjob angeben (/etc/cron.d/froxlor)!';
|
$lng['serversettings']['system_cronconfig']['description'] = 'Pfad zur Konfigurationsdatei des Cron-Dienstes. Diese Datei wird von froxlor automatisch aktualisiert.<br />Hinweis: bitte verwenden Sie <b>exakt</b> die gleiche Datei wie für den Froxlor-Haupt-Cronjob angeben (Standard: /etc/cron.d/froxlor)!';
|
||||||
$lng['tasks']['remove_ftpacc_files'] = 'Kunden FTP-Konto Dateien löschen';
|
$lng['tasks']['remove_ftpacc_files'] = 'Kunden FTP-Konto Dateien löschen';
|
||||||
$lng['tasks']['regenerating_crond'] = 'Neuerstellung der cron.d-Datei';
|
$lng['tasks']['regenerating_crond'] = 'Neuerstellung der cron.d-Datei';
|
||||||
$lng['serversettings']['system_crondreload']['title'] = 'Cron-Daemon reload Befehl';
|
$lng['serversettings']['system_crondreload']['title'] = 'Cron-Daemon reload Befehl';
|
||||||
|
|||||||
Reference in New Issue
Block a user