summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-09-03 08:55:59 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-09-03 08:55:59 -0300
commit42ec9337ea432906c7fa9ee99f763946fd974e3c (patch)
tree6cb53d843d8a8eebd2b6cd059c473851023d7459 /etc
parentbee7cd82f805daf11c53515059f45ad0da20de7f (diff)
downloadpfsense-42ec9337ea432906c7fa9ee99f763946fd974e3c.zip
pfsense-42ec9337ea432906c7fa9ee99f763946fd974e3c.tar.gz
Make sure RRD data is restored from backup before upgrading data and a new backup is done after. It should fix #2159
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/upgrade_config.inc22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index f7c5240..a78c393 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -2653,6 +2653,14 @@ function upgrade_080_to_081() {
$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 (restore_rrd()) {
+ /* 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 {$g['cf_conf_path']}/backup");
+ }
+ }
+
$rrdinterval = 60;
$valid = $rrdinterval * 2;
@@ -2782,6 +2790,9 @@ function upgrade_080_to_081() {
}
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 NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='{$g['cf_conf_path']}' /etc/rc.backup_rrd.sh");
if ($g['booting'])
echo "Updating configuration...";
foreach($config['filter']['rule'] as & $rule) {
@@ -3092,6 +3103,14 @@ function upgrade_095_to_096() {
$rrddbpath = "/var/db/rrd";
$rrdtool = "/usr/local/bin/rrdtool";
+ if ($g['platform'] != "pfSense") {
+ /* restore the databases, if we have one */
+ if (restore_rrd()) {
+ /* 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 {$g['cf_conf_path']}/backup");
+ }
+ }
+
/* Assume 2*10GigE for now */
$stream = 2500000000;
@@ -3109,6 +3128,9 @@ function upgrade_095_to_096() {
}
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 NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='{$g['cf_conf_path']}' /etc/rc.backup_rrd.sh");
}
function upgrade_096_to_097() {
OpenPOWER on IntegriCloud