From 4c3f186ebd54de5fb6f5ac87c479b44c2c3c18b3 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Tue, 19 Dec 2006 22:17:45 +0000 Subject: Actually set up and use the alternative paths for the log and cache. --- packages/squid.inc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'packages') diff --git a/packages/squid.inc b/packages/squid.inc index c10217a0..52afba14 100644 --- a/packages/squid.inc +++ b/packages/squid.inc @@ -37,8 +37,6 @@ require_once('filter.inc'); require_once('service-utils.inc'); define('SQUID_CONFBASE', '/usr/local/etc/squid'); -define('SQUID_LOGDIR', '/var/squid/log'); -define('SQUID_CACHEDIR', '/var/squid/cache'); define('SQUID_ACLDIR', '/var/squid/acl'); define('SQUID_PASSWD', '/var/etc/squid.passwd'); @@ -112,8 +110,6 @@ EOD; write_rcfile($rc); foreach (array( SQUID_CONFBASE, - SQUID_LOGDIR, - SQUID_CACHEDIR, SQUID_ACLDIR, ) as $dir) { make_dirs($dir); @@ -134,7 +130,11 @@ EOD; } function squid_deinstall_command() { - mwexec('rm -rf ' . CACHEDIR); + global $config; + $settings = $config['installedpackages']['squidcache']['config'][0]; + $cachedir =($settings['harddisk_cache_location'] ? $settings['harddisk_cache_location'] : '/var/squid/cache'); + + mwexec('rm -rf $cachedir'); mwexec('rm -f /usr/local/etc/rc.d/proxy_monitor.sh'); mwexec("ps awux | grep \"proxy_monitor\" | grep -v \"grep\" | grep -v \"php\" | awk '{ print $2 }' | xargs kill"); mwexec("ps awux | grep \"squid\" | grep -v \"grep\" | awk '{ print $2 }' | xargs kill"); @@ -365,8 +365,10 @@ function squid_resync_general() { $hostname = ($settings['visible_hostname'] ? $settings['visible_hostname'] : 'localhost'); $email = ($settings['admin_email'] ? $settings['admin_email'] : 'admin@localhost'); - $logdir_cache = SQUID_LOGDIR . '/cache.log'; - $logdir_access = ($settings['log_enabled'] == 'on' ? SQUID_LOGDIR . '/access.log' : '/dev/null'); + $logdir = ($settings['log_dir'] ? $settings['log_dir'] : '/var/squid/log'); + + $logdir_cache = $logdir . '/cache.log'; + $logdir_access = ($settings['log_enabled'] == 'on' ? $logdir . '/access.log' : '/dev/null'); $conf .= <<