diff --git a/actions/admin/settings/125.cronjob.php b/actions/admin/settings/125.cronjob.php index d03132b3..8657ff09 100644 --- a/actions/admin/settings/125.cronjob.php +++ b/actions/admin/settings/125.cronjob.php @@ -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', diff --git a/install/froxlor.sql b/install/froxlor.sql index 7989286b..43a3d8cf 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -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`; diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 6518737c..da3ce676 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -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'); +} diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index 4e3eef80..abf4f54b 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -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/)

'; $question = 'Path to the cron-service configuration-file. This file will be updated regularly and automatically by froxlor.
Note: Do not use the same filename as for the main froxlor cronjob (/etc/cron.d/froxlor)!
'; - $question.= '
'; + $question.= '
'; 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.

'; + $question = 'Please specify the reload-command of your cron-daemon (default: /etc/init.d/cron reload)
'; + $question.= '
'; + eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); + } + } diff --git a/lib/functions/froxlor/function.checkCrondConfigurationFile.php b/lib/functions/froxlor/function.checkCrondConfigurationFile.php index ffb25edb..bffb7795 100644 --- a/lib/functions/froxlor/function.checkCrondConfigurationFile.php +++ b/lib/functions/froxlor/function.checkCrondConfigurationFile.php @@ -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; } diff --git a/lib/tables.inc.php b/lib/tables.inc.php index b2ca35d9..6547a80b 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -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 = ''; diff --git a/lng/english.lng.php b/lng/english.lng.php index fb80b4f7..a7f76840 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -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.
Note: Do not 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'; diff --git a/lng/german.lng.php b/lng/german.lng.php index f57db514..b0cff106 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -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.
Hinweis: bitte nicht 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';