add cron-daemon reload command in order for new cron.d file to be applied, fixes #858

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-01-23 13:22:11 +01:00
parent d66e375d8a
commit abcdfb03d9
8 changed files with 44 additions and 4 deletions

View File

@@ -29,6 +29,14 @@ return array(
'default' => '/etc/cron.d/froxlor-services',
'save_method' => 'storeSettingField',
),
'system_crondreload' => array(
'label' => $lng['serversettings']['system_crondreload'],
'settinggroup' => 'system',
'varname' => 'crondreload',
'type' => 'string',
'default' => '/etc/init.d/cron reload',
'save_method' => 'storeSettingField',
),
'system_debug_cron' => array(
'label' => $lng['serversettings']['cron']['debug'],
'settinggroup' => 'system',

View File

@@ -499,7 +499,8 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('system', 'mdaserver', 'dovecot'),
('system', 'mtaserver', 'postfix'),
('system', 'mailtraffic_enabled', '1'),
('system', 'cronconfig', '/etc/cron.d/froxlor'),
('system', 'cronconfig', '/etc/cron.d/froxlor-services'),
('system', 'crondreload', '/etc/init.d/cron reload'),
('panel', 'decimal_places', '4'),
('panel', 'adminmail', 'admin@SERVERNAME'),
('panel', 'phpmyadmin_url', ''),
@@ -527,7 +528,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('panel', 'phpconfigs_hidestdsubdomain', '0'),
('panel', 'allow_theme_change_admin', '1'),
('panel', 'allow_theme_change_customer', '1'),
('panel', 'version', '0.9.32-dev5');
('panel', 'version', '0.9.32-dev6');
DROP TABLE IF EXISTS `panel_tasks`;

View File

@@ -2701,3 +2701,18 @@ if (isFroxlorVersion('0.9.32-dev4')) {
updateToVersion('0.9.32-dev5');
}
if (isFroxlorVersion('0.9.32-dev54')) {
showUpdateStep("Updating from 0.9.32-dev5 to 0.9.32-dev6", false);
showUpdateStep("Adding new settings for cron-daemon reload command");
// get user-chosen value
$crondreload = isset($_POST['crondreload']) ? $_POST['crondreload'] : "/etc/init.d/cron reload";
Settings::AddNew("system.crondreload", $crondreload);
// add task to generate cron.d-file
inserttask('99');
lastStepStatus(0);
updateToVersion('0.9.32-dev6');
}

View File

@@ -638,7 +638,16 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) {
$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" /><br />';
$question.= '<input type="text" class="text" name="crondfile" value="/etc/cron.d/froxlor-services" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if (versionInUpdate($current_version, '0.9.32-dev6')) {
$has_preconfig = true;
$description = 'In order for the new cron.d file to work properly, we need to know about the cron-service reload command.<br /><br />';
$question = '<strong>Please specify the reload-command of your cron-daemon</strong> (default: /etc/init.d/cron reload)<br />';
$question.= '<input type="text" class="text" name="crondreload" value="/etc/init.d/cron reload" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}

View File

@@ -93,6 +93,9 @@ function checkCrondConfigurationFile() {
// remove all re-generation tasks
Database::query("DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `type` = '99'");
// run reload command
safe_exec(escapeshellcmd(Settings::Get('system.crondreload')));
}
return true;
}

View File

@@ -51,6 +51,6 @@ define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings');
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
// VERSION INFO
$version = '0.9.32-dev5';
$version = '0.9.32-dev6';
$dbversion = '2';
$branding = '';

View File

@@ -1802,3 +1802,5 @@ $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['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';
$lng['serversettings']['system_crondreload']['description'] = 'Specify the command to execute in order to reload your systems cron-daemon';

View File

@@ -1528,3 +1528,5 @@ $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['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';
$lng['serversettings']['system_crondreload']['description'] = 'Geben Sie hier den Befehl zum Neuladen des Cron-Daemons an';