diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2006-12-20 10:40:06 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2006-12-20 10:40:06 +0000 |
commit | 9e38c1e55891261ad8b9d807060f483b30bfe325 (patch) | |
tree | dfee7b0279b9fb5d832a0f6a1aa13d8d6db4afe9 /packages | |
parent | f157aa2db0e0d54619c636f7cf4317266ec229d2 (diff) | |
download | pfsense-packages-9e38c1e55891261ad8b9d807060f483b30bfe325.tar.gz pfsense-packages-9e38c1e55891261ad8b9d807060f483b30bfe325.tar.bz2 pfsense-packages-9e38c1e55891261ad8b9d807060f483b30bfe325.zip |
Further Squid cache creation fixes, more verbosity
Diffstat (limited to 'packages')
-rw-r--r-- | packages/squid.inc | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/packages/squid.inc b/packages/squid.inc index 5b3b2d53..2423c48f 100644 --- a/packages/squid.inc +++ b/packages/squid.inc @@ -53,24 +53,6 @@ function squid_get_real_interface_address($iface) { return array($ip, long2ip(hexdec($netmask))); } -/* setup cache */ -function squid_dash_z() { - global $config; - $settings = $config['installedpackages']['squidcache']['config'][0]; - $cachedir =($settings['harddisk_cache_location'] ? $settings['harddisk_cache_location'] : '/var/squid/cache'); - - if(!is_dir($cachedir)) { - make_dirs($cachedir); - squid_chown_recursive($cachedir, 'proxy', 'proxy'); - } - - if(!is_dir($cachedir.'01/')) { - log_error("Creating squid cache dir in $cachedir"); - mwexec("/usr/local/sbin/squid -z"); - } - -} - function squid_chown_recursive($dir, $user, $group) { chown($dir, $user); chgrp($dir, $group); @@ -88,6 +70,25 @@ function squid_chown_recursive($dir, $user, $group) { } } +/* setup cache */ +function squid_dash_z() { + global $config; + $settings = $config['installedpackages']['squidcache']['config'][0]; + $cachedir =($settings['harddisk_cache_location'] ? $settings['harddisk_cache_location'] : '/var/squid/cache'); + + if(!is_dir($cachedir)) { + log_error("Creating Squid cache dir $cachedir"); + make_dirs($cachedir); + squid_chown_recursive($cachedir, 'proxy', 'proxy'); + } + + if(!is_dir($cachedir.'/00')) { + log_error("Creating squid cache subdirs in $cachedir"); + mwexec("/usr/local/sbin/squid -z"); + } + +} + function squid_is_valid_acl($acl) { global $valid_acls; if(!is_array($valid_acls)) @@ -739,10 +740,10 @@ function squid_resync() { file_put_contents(SQUID_CONFBASE . '/squid.conf', $conf); - $disk_cache_location = $config['installedpackages']['squidcache']['config'][0]['harddisk_cache_location'].'/'; $log_dir = $config['installedpackages']['squid']['config'][0]['log_dir'].'/'; if(!is_dir($log_dir)) { + log_error("Creating squid log dir $log_dir"); make_dirs($log_dir); squid_chown_recursive($log_dir, 'proxy', 'proxy'); } |