diff options
author | smos <seth.mos@dds.nl> | 2011-10-13 14:12:39 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2011-10-13 14:28:19 +0200 |
commit | eb5e790f09045b5e2dfbf29b5d80c11bbfa0b078 (patch) | |
tree | ffe1ba06c25d2766dd58e1a61e0ea360cd03ca45 | |
parent | 3f57df7582b4b6d13272f3103e219259a07c5af7 (diff) | |
download | pfsense-eb5e790f09045b5e2dfbf29b5d80c11bbfa0b078.zip pfsense-eb5e790f09045b5e2dfbf29b5d80c11bbfa0b078.tar.gz |
Restore the RRD backup before attempting a migration as this bites the nanobsd users.
We immediately backup the new databases to a new rrd.tgz file. The old database will be moved to /root
Fix for ticket #1758
-rw-r--r-- | etc/inc/upgrade_config.inc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index c0fd8cb..501a2bc 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1936,6 +1936,17 @@ function upgrade_054_to_055() { $rrddbpath = "/var/db/rrd/"; $rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool"; + if ($g['platform'] != "pfSense") { + /* restore the databases, if we have one */ + if (file_exists("{$g['cf_conf_path']}/rrd.tgz")) { + exec("cd /;LANG=C /usr/bin/tar -xzf {$g['cf_conf_path']}/rrd.tgz 2>&1", $rrdrestore, $rrdreturn); $rrdrestore = implode(" ", $rrdrestore); + if($rrdreturn <> 0) { + log_error("RRD restore failed exited with $rrdreturn, the error is: $rrdrestore\n"); + } + /* Make sure to move the rrd backup out of the way. We will make a new one after converting. */ + exec("/bin/mv {$g['cf_conf_path']}/rrd.tgz /root/"); + } + } $rrdinterval = 60; $valid = $rrdinterval * 2; @@ -2049,6 +2060,9 @@ function upgrade_054_to_055() { } enable_rrd_graphing(); + /* Let's save the RRD graphs after we run enable RRD graphing */ + /* The function will restore the rrd.tgz so we will save it after */ + exec("cd /;LANG=C /usr/bin/tar -czf {$g['cf_conf_path']}/rrd.tgz -C / var/db/rrd/*.rrd"); if ($g['booting']) echo "Updating configuration..."; } |