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:
Michael Kaufmann (d00p)
2014-01-23 13:59:09 +01:00
parent 6d1899d72e
commit 019da862dd
7 changed files with 19 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ return array(
'varname' => 'cronconfig',
'type' => 'string',
'string_type' => 'file',
'default' => '/etc/cron.d/froxlor-services',
'default' => '/etc/cron.d/froxlor',
'save_method' => 'storeSettingField',
),
'system_crondreload' => array(

View File

@@ -499,7 +499,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('system', 'mdaserver', 'dovecot'),
('system', 'mtaserver', 'postfix'),
('system', 'mailtraffic_enabled', '1'),
('system', 'cronconfig', '/etc/cron.d/froxlor-services'),
('system', 'cronconfig', '/etc/cron.d/froxlor'),
('system', 'crondreload', '/etc/init.d/cron reload'),
('panel', 'decimal_places', '4'),
('panel', 'adminmail', 'admin@SERVERNAME'),

View File

@@ -2692,7 +2692,7 @@ if (isFroxlorVersion('0.9.32-dev4')) {
showUpdateStep("Adding new settings for cron");
// 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);
Settings::AddNew("system.cronconfig", $crondfile);
// add task to generate cron.d-file

View File

@@ -637,8 +637,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
if (versionInUpdate($current_version, '0.9.32-dev5')) {
$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 />';
$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.= '<input type="text" class="text" name="crondfile" value="/etc/cron.d/froxlor-services" /><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" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}

View File

@@ -31,8 +31,19 @@ if (function_exists("date_default_timezone_set")
@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/';
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
$lockFilename = 'froxlor_' . $basename . '.lock-';
$lockfName = $lockFilename . getmypid();
$lockfile = $lockdir . $lockfName;

View File

@@ -1799,7 +1799,7 @@ $lng['serversettings']['mtalog']['description'] = "Logfile of the Mail Transfer
$lng['panel']['ftpdesc'] = 'FTP description';
$lng['admin']['cronsettings'] = 'Cronjob settings';
$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']['regenerating_crond'] = 'Rebuilding the cron.d-file';
$lng['serversettings']['system_crondreload']['title'] = 'Cron-daemon reload command';

View File

@@ -1525,7 +1525,7 @@ $lng['serversettings']['mtalog']['description'] = "Die Logdatei des Mail Transfe
$lng['panel']['ftpdesc'] = 'FTP Beschreibung';
$lng['admin']['cronsettings'] = 'Cronjob Einstellungen';
$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']['regenerating_crond'] = 'Neuerstellung der cron.d-Datei';
$lng['serversettings']['system_crondreload']['title'] = 'Cron-Daemon reload Befehl';