[yast-commit] r39154 - in /trunk/backup: VERSION package/yast2-backup.changes src/Backup.ycp
Author: locilka Date: Wed Jul 4 11:16:29 2007 New Revision: 39154 URL: http://svn.opensuse.org/viewcvs/yast?rev=39154&view=rev Log: - Restart and/or enable cron service if needed for changed/added scheduled backups (#285442). - 2.15.4 Modified: trunk/backup/VERSION trunk/backup/package/yast2-backup.changes trunk/backup/src/Backup.ycp Modified: trunk/backup/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/VERSION?rev=39154&r1=39153... ============================================================================== --- trunk/backup/VERSION (original) +++ trunk/backup/VERSION Wed Jul 4 11:16:29 2007 @@ -1 +1 @@ -2.15.3 +2.15.4 Modified: trunk/backup/package/yast2-backup.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/package/yast2-backup.chang... ============================================================================== --- trunk/backup/package/yast2-backup.changes (original) +++ trunk/backup/package/yast2-backup.changes Wed Jul 4 11:16:29 2007 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Jul 4 11:13:22 CEST 2007 - locilka@suse.cz + +- Restart and/or enable cron service if needed for changed/added + scheduled backups (#285442). +- 2.15.4 + +------------------------------------------------------------------- Fri May 25 13:30:04 CEST 2007 - jsrain@suse.cz - removed outdated translations from .desktop-files (#271209) Modified: trunk/backup/src/Backup.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/src/Backup.ycp?rev=39154&r... ============================================================================== --- trunk/backup/src/Backup.ycp (original) +++ trunk/backup/src/Backup.ycp Wed Jul 4 11:16:29 2007 @@ -27,6 +27,7 @@ import "Popup"; import "FileUtils"; import "String"; +import "Service"; include "backup/functions.ycp"; @@ -1071,6 +1072,9 @@ global define void WriteCronSettings() ``{ y2milestone("backup_profiles: %1", backup_profiles); + boolean cron_settings_changed = false; + boolean cron_is_needed = false; + // write cron files foreach(string name, map opts, backup_profiles, ``{ // cron file content @@ -1096,12 +1100,17 @@ SCR::Write(.target.string, cron_file, setting); y2milestone("Created file: %1", cron_file); + + cron_settings_changed = true; + cron_is_needed = true; } else if (size(cron_file) > 0 && opts[`cron_settings, "auto"]:false == false) { // remove existing cron file SCR::Execute(.target.bash, "/bin/rm -f " + cron_file); y2milestone("removed old cron file: %1", cron_file); + + cron_settings_changed = true; } // mark saved value as unchanged @@ -1113,6 +1122,23 @@ backup_profiles[name] = (map)eval(prof); } ); + + // Cron needs to be restarted for changes to take effect + // bugzilla #285442 + if (cron_settings_changed) { + // running + if (Service::Status("cron") == 0) { + // restart it only + Service::Restart ("cron"); + + // not running but needed + } else if (cron_is_needed) { + // not enabled, enable it + if (! Service::Enabled ("cron")) Service::Enable ("cron"); + // and start it + Service::Start ("cron"); + } + } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org