diff options
-rw-r--r-- | config/squid/squid.inc | 21 | ||||
-rw-r--r-- | config/squid/squid_cache.xml | 6 | ||||
-rwxr-xr-x | pkg_config.7.xml | 3 |
3 files changed, 24 insertions, 6 deletions
diff --git a/config/squid/squid.inc b/config/squid/squid.inc index 1f264a64..4f3bd034 100644 --- a/config/squid/squid.inc +++ b/config/squid/squid.inc @@ -676,13 +676,12 @@ EOD; function squid_resync_cache() { - global $config; + global $config, $g; $settings = $config['installedpackages']['squidcache']['config'][0]; $cachedir =($settings['harddisk_cache_location'] ? $settings['harddisk_cache_location'] : '/var/squid/cache'); $disk_cache_size = ($settings['harddisk_cache_size'] ? $settings['harddisk_cache_size'] : 100); - $disk_cache_system = ($settings['harddisk_cache_system'] ? $settings['harddisk_cache_system'] : 'aufs'); $level1 = ($settings['level1_subdirs'] ? $settings['level1_subdirs'] : 16); $memory_cache_size = ($settings['memory_cache_size'] ? $settings['memory_cache_size'] : 8); $max_objsize = ($settings['maximum_object_size'] ? $settings['maximum_object_size'] : 10); @@ -691,12 +690,28 @@ function squid_resync_cache() { $memory_policy = ($settings['memory_replacement_policy'] ? $settings['memory_replacement_policy'] : 'heap GDSF'); $offline_mode = ($settings['enable_offline'] == 'on' ? 'on' : 'off'); + if (!isset($settings['harddisk_cache_system'])) { + if ($g['platform'] == "nanobsd") { + $disk_cache_system = 'null'; + } else { + $disk_cache_system = 'aufs'; + } + } else { + $disk_cache_system = $settings['harddisk_cache_system']; + } + + if ($disk_cache_system == "null") { + $disk_cache_opts = "{$disk_cache_system} /tmp"; + } else { + $disk_cache_opts = "{$disk_cache_system} {$cachedir} {$disk_cache_size} {$level1} 256"; + } + $conf = <<<EOD cache_mem $memory_cache_size MB maximum_object_size_in_memory 32 KB memory_replacement_policy $memory_policy cache_replacement_policy $cache_policy -cache_dir $disk_cache_system $cachedir $disk_cache_size $level1 256 +cache_dir $disk_cache_opts minimum_object_size $min_objsize KB maximum_object_size $max_objsize KB offline_mode $offline_mode diff --git a/config/squid/squid_cache.xml b/config/squid/squid_cache.xml index 52735bbe..dcb7e788 100644 --- a/config/squid/squid_cache.xml +++ b/config/squid/squid_cache.xml @@ -92,13 +92,14 @@ <field> <fielddescr>Hard disk cache system</fielddescr> <fieldname>harddisk_cache_system</fieldname> - <description>This specifies the kind of storage system to use. <p> <b> ufs </b> is the old well-known Squid storage format that has always been there. <p> <b> aufs </b> uses POSIX-threads to avoid blocking the main Squid process on disk-I/O. (Formerly known as async-io.) <p> <b> diskd </b> uses a separate process to avoid blocking the main Squid process on disk-I/O.</description> + <description>This specifies the kind of storage system to use. <p> <b> ufs </b> is the old well-known Squid storage format that has always been there. <p> <b> aufs </b> uses POSIX-threads to avoid blocking the main Squid process on disk-I/O. (Formerly known as async-io.) <p> <b> diskd </b> uses a separate process to avoid blocking the main Squid process on disk-I/O. <p> <b> null </b> Does not use any storage.</description> <type>select</type> <default_value>aufs</default_value> <options> <option><name>ufs</name><value>ufs</value></option> <option><name>aufs</name><value>aufs</value></option> <option><name>diskd</name><value>diskd</value></option> + <option><name>null</name><value>null</value></option> </options> </field> <field> @@ -208,6 +209,9 @@ </field> </fields> <custom_php_command_before_form> + if (($g['platform'] == "nanobsd") && (!isset($config['installedpackages']['squidcache']['config'][0]['harddisk_cache_system']))) { + $config['installedpackages']['squidcache']['config'][0]['harddisk_cache_system'] = "null"; + } if($_POST['harddisk_cache_size'] != $config['installedpackages']['squidcache']['config'][0]['harddisk_cache_size']) { $needs_dash_z = true; } diff --git a/pkg_config.7.xml b/pkg_config.7.xml index bc0e0d57..65e109c9 100755 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -747,7 +747,7 @@ <descr>High performance web proxy cache.</descr> <website>http://www.squid-cache.org/</website> <category>Network</category> - <version>2.7.8_1</version> + <version>2.7.8_2</version> <status>Stable</status> <required_version>1.2.1</required_version> <maintainer>fernando@netfilter.com.br seth.mos@xs4all.nl mfuchs77@googlemail.com</maintainer> @@ -757,7 +757,6 @@ <depends_on_package>openldap-client-2.4.10.tbz</depends_on_package> <config_file>http://www.pfsense.org/packages/config/squid/squid.xml</config_file> <configurationfile>squid.xml</configurationfile> - <noembedded>true</noembedded> </package> <package> <name>squid3</name> |