diff options
author | doktornotor <notordoktor@gmail.com> | 2015-10-10 11:56:55 +0200 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-10-10 11:56:55 +0200 |
commit | eb1b3299ae63a7f7933487bee8e9ae3454a11680 (patch) | |
tree | 9f5b46daa7c58195ea7ec067c6a113bca50ddacc | |
parent | f15eb1c05d8c5f3bd0c3040ea9dc65d778f8f670 (diff) | |
download | pfsense-packages-eb1b3299ae63a7f7933487bee8e9ae3454a11680.tar.gz pfsense-packages-eb1b3299ae63a7f7933487bee8e9ae3454a11680.tar.bz2 pfsense-packages-eb1b3299ae63a7f7933487bee8e9ae3454a11680.zip |
Remove 'Clear Cache on Log Rotate' misfeature from local cache settings
This has only been a source of complaints, breakage and confusion, plus was breaking Save on the General tab for people.
-rwxr-xr-x | config/squid3/34/squid.inc | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/config/squid3/34/squid.inc b/config/squid3/34/squid.inc index 15854317..cbb24a04 100755 --- a/config/squid3/34/squid.inc +++ b/config/squid3/34/squid.inc @@ -260,7 +260,7 @@ function squid_dash_z($cache_action = 'none') { return; } - // Re-create the cachedir if clean is forced by cronjob/manually, + // Re-create the cachedir if clean is forced by manually, // or if the cachedir changed, or level1_subdirs don't exist or the number of level1_subdirs changed if ($cache_action == "clean" || !is_dir($cachedir) || !is_dir($cachedir . '/00') || $numdirs != $currentdirs) { // cannot nuke disk cache while Squid is running @@ -319,32 +319,15 @@ function squid_create_cachedir() { /* Handle cronjob install/uninstall */ function squid_install_cron($should_install) { - global $config; - if (platform_booting()) { return; } - parse_config(true); - if (is_array($config['installedpackages']['squidcache'])) { - $settings = $config['installedpackages']['squidcache']['config'][0]; - } else { - $settings = array(); - } - - $cron_cmd = ($settings['clear_cache'] == 'on' ? "/usr/local/pkg/swapstate_check.php clean; " : ""); - $cron_cmd .= SQUID_BASE . "/sbin/squid -k rotate -f " . SQUID_CONFFILE; - install_cron_job("{$cron_cmd}", $should_install, "0", "0", "*", "*", "*", "root"); - - $swapstate_cmd = "/usr/local/pkg/swapstate_check.php clean; "; + $cron_cmd = SQUID_BASE . "/sbin/squid -k rotate -f " . SQUID_CONFFILE; if (($should_install) && (squid_enabled())) { - if ($settings['clear_cache'] == 'on' ) { - install_cron_job("{$swapstate_cmd}", true, "*/360"); - } else { - install_cron_job("{$swapstate_cmd}", false); - } + install_cron_job("{$cron_cmd}", $should_install, "0", "0", "*", "*", "*", "root"); } else { - install_cron_job("{$swapstate_cmd}", false); + install_cron_job("{$cron_cmd}", false); } } @@ -507,6 +490,9 @@ function squid_install_command() { // remove unwanted PBI rc script unlink_if_exists("/usr/local/etc/rc.d/squid"); + // remove broken cronjob possibly left over after 'Clear Cache on Log Rotate' misfeature + install_cron_job("/usr/local/pkg/swapstate_check.php clean;", false); + } function squid_deinstall_command() { |