diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-09-03 08:55:59 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-09-03 08:56:22 -0300 |
commit | 7ca8bef40e29d1a4ef7a641141401f51297cc101 (patch) | |
tree | eacecdb64864fd22b110bf4b0dc7555251b67578 /etc | |
parent | 7cb3f7d26dd5770f666207f86899fb1529991622 (diff) | |
download | pfsense-7ca8bef40e29d1a4ef7a641141401f51297cc101.zip pfsense-7ca8bef40e29d1a4ef7a641141401f51297cc101.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.inc | 22 |
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() { |