introducing new way of controling the cronjobs by creating a cron.d-file

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-01-13 08:55:39 +01:00
parent c5efe9fd7f
commit 4be52f76eb
14 changed files with 232 additions and 141 deletions

View File

@@ -2430,9 +2430,9 @@ if (isFroxlorVersion('0.9.31-dev1')) {
INSERT INTO `".TABLE_PANEL_SETTINGS."` SET `settinggroup` = 'phpfpm', `varname` = 'fastcgi_ipcdir', `value` = :value
");
$params = array();
if (Settings::Get('system.webserver') == 'apache2') {
$params['value'] = '/var/lib/apache2/fastcgi/';
} elseif (Settings::Get('system.webserver') == 'lighttpd') {
// set default for apache (which will suite in most cases)
$params['value'] = '/var/lib/apache2/fastcgi/';
if (Settings::Get('system.webserver') == 'lighttpd') {
$params['value'] = '/var/run/lighttpd/';
} elseif (Settings::Get('system.webserver') == 'nginx') {
$params['value'] = '/var/run/nginx/';
@@ -2680,3 +2680,24 @@ if (isFroxlorVersion('0.9.32-dev3')) {
updateToVersion('0.9.32-dev4');
}
if (isFroxlorVersion('0.9.32-dev4')) {
showUpdateStep("Updating from 0.9.32-dev4 to 0.9.32-dev5");
lastStepStatus(0);
showUpdateStep("Updating cronjob table");
Database::query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `cronfile` = REPLACE( REPLACE(`cronfile`, 'cron_', ''), '.php', '')");
lastStepStatus(0);
showUpdateStep("Adding new settings for cron");
// get user-chosen value
$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
inserttask('99');
lastStepStatus(0);
updateToVersion('0.9.32-dev5');
}