Fixed bug that deletes running on startup if backup started with -m running.

This commit is contained in:
Olof hagsand 2017-12-10 15:38:42 +01:00
parent c3f7a50e61
commit a150eec7be
2 changed files with 12 additions and 1 deletions

View file

@ -1,5 +1,11 @@
# Clixon Changelog
* Fixed bug that deletes running on startup if backup started with -m running.
When clixon starts again, running is lost.
The error was that the running (or startup) configuration may fail when
clixon backend starts.
The fix now makes a copy of running and copies it back on failure
## 3.3.3 (25 November 2017)
Thanks to Matthew Smith, Joe Loeliger at Netgate; Fredrik Pettai at

View file

@ -536,8 +536,13 @@ startup_mode_running(clicon_handle h,
if (load_extraxml(h, extraxml_file, "tmp") < 0)
goto done;
/* Commit original running */
if (candidate_commit(h, "candidate") < 0)
if (candidate_commit(h, "candidate") < 0){
clicon_log(LOG_NOTICE, "%s: Commit of saved running failed, exiting.", __FUNCTION__);
/* Reinstate original */
if (xmldb_copy(h, "candidate", "running") < 0)
goto done;
goto done;
}
/* Merge user reset state and extra xml file (no commit) */
if (db_merge(h, "tmp", "running") < 0)
goto done;