bugfix new cron.d-file generation and don't overwrite our master, refs #858

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-01-13 13:42:02 +01:00
parent 4be52f76eb
commit 17255de669
7 changed files with 7 additions and 5 deletions

View File

@@ -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', 'default' => '/etc/cron.d/froxlor-services',
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField',
), ),
'system_debug_cron' => array( 'system_debug_cron' => array(

View File

@@ -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"; $crondfile = isset($_POST['crondfile']) ? $_POST['crondfile'] : "/etc/cron.d/froxlor-services";
$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

View File

@@ -637,7 +637,7 @@ 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 />'; $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" /><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") . "\";");
} }

View File

@@ -35,6 +35,7 @@ function checkCrondConfigurationFile() {
$cronfile = "# automatically generated cron-configuration by froxlor\ņ"; $cronfile = "# automatically generated cron-configuration by froxlor\ņ";
$cronfile.= "# do not manually edit this file as it will be re-generated periodically.\ņ"; $cronfile.= "# do not manually edit this file as it will be re-generated periodically.\ņ";
$cronfile.= "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n#\n"; $cronfile.= "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n#\n";
$cronfile.= "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n#\n";
// get all the crons // get all the crons
$result_stmt = Database::query(" $result_stmt = Database::query("

View File

@@ -34,6 +34,7 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '
|| $type == '4' || $type == '4'
|| $type == '5' || $type == '5'
|| $type == '10' || $type == '10'
|| $type == '99'
) { ) {
// 4 = bind -> if bind disabled -> no task // 4 = bind -> if bind disabled -> no task
if ($type == '4' && Settings::Get('system.bind_enable') == '0') { if ($type == '4' && Settings::Get('system.bind_enable') == '0') {

View File

@@ -1799,4 +1799,4 @@ $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.'; $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)!';

View File

@@ -1525,4 +1525,4 @@ $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.'; $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-Hautp-Cronjob angeben (/etc/cron.d/froxlor)!';