aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-11-05 21:42:43 +0545
committerPhil Davis <phil.davis@inf.org>2014-11-05 21:42:43 +0545
commit827972f0c8b83f36713e2763813b1ca3db678311 (patch)
tree0dea1c96b70625d1176d400ff81aef01bbb22e3c /config
parent8fbae6eab338a277decaafe786f05fde482f3151 (diff)
downloadpfsense-packages-827972f0c8b83f36713e2763813b1ca3db678311.tar.gz
pfsense-packages-827972f0c8b83f36713e2763813b1ca3db678311.tar.bz2
pfsense-packages-827972f0c8b83f36713e2763813b1ca3db678311.zip
Apply swapstate file exists check to Squid3
Issue reported in forum https://forum.pfsense.org/index.php?topic=78733.msg This extra check was applied to Squid2 back in 2013.
Diffstat (limited to 'config')
-rw-r--r--config/squid3/31/swapstate_check.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/squid3/31/swapstate_check.php b/config/squid3/31/swapstate_check.php
index 6ecfff3c..52a6c66c 100644
--- a/config/squid3/31/swapstate_check.php
+++ b/config/squid3/31/swapstate_check.php
@@ -41,6 +41,8 @@ else
if ($settings['harddisk_cache_system'] != "null"){
$cachedir =($settings['harddisk_cache_location'] ? $settings['harddisk_cache_location'] : '/var/squid/cache');
$swapstate = $cachedir . '/swap.state';
+ if (!file_exists($swapstate))
+ return;
$disktotal = disk_total_space(dirname($cachedir));
$diskfree = disk_free_space(dirname($cachedir));
$diskusedpct = round((($disktotal - $diskfree) / $disktotal) * 100);
@@ -55,4 +57,4 @@ if ($settings['harddisk_cache_system'] != "null"){
log_error(gettext(sprintf("Squid swap.state file exceeded size limits. Removing and rotating. File was %d bytes, %d%% of total disk space.", $swapstate_size, $swapstate_pct)));
}
}
-?> \ No newline at end of file
+?>