diff options
author | jim-p <jimp@pfsense.org> | 2011-04-27 10:43:51 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-04-27 10:43:51 -0400 |
commit | 38439ef8cfaa2a778c02981c6c2e72c55a27ba7f (patch) | |
tree | d9dfea754724094591762361dcbfda0384ec2ffd /config | |
parent | 780af2e7678dcccf0fd730a06549facd00906707 (diff) | |
download | pfsense-packages-38439ef8cfaa2a778c02981c6c2e72c55a27ba7f.tar.gz pfsense-packages-38439ef8cfaa2a778c02981c6c2e72c55a27ba7f.tar.bz2 pfsense-packages-38439ef8cfaa2a778c02981c6c2e72c55a27ba7f.zip |
Stop squid from doing a recursive chown/chgrp inside the cache folder, should speed up save/sync with a large cache. Version bump to reflect change.
Diffstat (limited to 'config')
-rw-r--r-- | config/squid/squid.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/config/squid/squid.inc b/config/squid/squid.inc index 792a121f..61498294 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -63,7 +63,8 @@ function squid_chown_recursive($dir, $user, $group) { while (($item = readdir($handle)) !== false) { if (($item != ".") && ($item != "..")) { $path = "$dir/$item"; - if (is_dir($path)) + // Recurse unless it's the cache dir, that is slow and rarely necessary. + if (is_dir($path) && (basename($dir) != "cache")) squid_chown_recursive($path, $user, $group); elseif (is_file($path)) { chown($path, $user); @@ -98,8 +99,11 @@ function squid_dash_z() { mwexec("/usr/local/sbin/squid -z"); } - if(file_exists("/var/squid/cache/swap.state")) + if(file_exists("/var/squid/cache/swap.state")) { + chown("/var/squid/cache/swap.state", "proxy"); + chgrp("/var/squid/cache/swap.state", "proxy"); exec("chmod a+rw /var/squid/cache/swap.state"); + } } |