diff options
author | Ermal LUÇI <eri@pfsense.org> | 2014-11-27 14:46:15 +0100 |
---|---|---|
committer | Ermal LUÇI <eri@pfsense.org> | 2014-11-27 14:48:19 +0100 |
commit | f72ea82a9bcdbcac6041e6df460f82517e762968 (patch) | |
tree | c9e0a805bac766280234e8376141ae53612ceaf9 /etc/inc | |
parent | 1a28657c6d81ad5d6cb660ccc1aa47edc48a3428 (diff) | |
download | pfsense-f72ea82a9bcdbcac6041e6df460f82517e762968.zip pfsense-f72ea82a9bcdbcac6041e6df460f82517e762968.tar.gz |
Put the safety belts for rrds on its proper location. No need to create /tmp and change permissions on these paths
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/gwlb.inc | 7 | ||||
-rw-r--r-- | etc/inc/rrd.inc | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 0cd31f3..83e86f6 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -151,13 +151,6 @@ target default { EOD; - if (is_dir("{$g['tmp_path']}")) - chmod("{$g['tmp_path']}", 01777); - if (!is_dir("{$g['vardb_path']}/rrd")) - mkdir("{$g['vardb_path']}/rrd", 0775); - - @chown("{$g['vardb_path']}/rrd", "nobody"); - $monitor_ips = array(); foreach($gateways_arr as $name => $gateway) { /* Do not monitor if such was requested */ diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index a5742e3..e88105e 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -310,6 +310,13 @@ function enable_rrd_graphing() { } } + if (platform_booting()) { + if (!is_dir("{$g['vardb_path']}/rrd")) + mkdir("{$g['vardb_path']}/rrd", 0775); + + @chown("{$g['vardb_path']}/rrd", "nobody"); + } + /* process all real and pseudo interfaces */ foreach ($ifdescrs as $ifname => $ifdescr) { $temp = get_real_interface($ifname); @@ -930,6 +937,7 @@ function enable_rrd_graphing() { # Create gateway quality RRD with settings suitable for pfSense graph set. function create_gateway_quality_rrd($rrd_file) { global $g; + $rrdinterval = 60; $valid = $rrdinterval * 2; $rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool"; @@ -950,6 +958,11 @@ function create_gateway_quality_rrd($rrd_file) { /* enter UNKNOWN values in the RRD so it knows we rebooted. */ if(platform_booting()) { + if (!is_dir("{$g['vardb_path']}/rrd")) + mkdir("{$g['vardb_path']}/rrd", 0775); + + @chown("{$g['vardb_path']}/rrd", "nobody"); + mwexec("$rrdtool update $rrd_file N:U:U"); } unset($rrdtool, $rrdinterval, $valid, $rrd_file); |