diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2012-05-04 18:18:08 -0300 |
---|---|---|
committer | marcelloc <marcellocoutinho@gmail.com> | 2012-05-04 18:18:08 -0300 |
commit | 6d1ec508780b4aa302bb18a986b230a3f16c4b54 (patch) | |
tree | ad25beee640276025057541eca8975e19f333026 /config | |
parent | 966c44e63d204906efaefebc66c9611f910486cb (diff) | |
download | pfsense-packages-6d1ec508780b4aa302bb18a986b230a3f16c4b54.tar.gz pfsense-packages-6d1ec508780b4aa302bb18a986b230a3f16c4b54.tar.bz2 pfsense-packages-6d1ec508780b4aa302bb18a986b230a3f16c4b54.zip |
sarg - more fixes to squidguard reports and rotate
Diffstat (limited to 'config')
-rw-r--r-- | config/sarg/sarg.inc | 10 | ||||
-rw-r--r-- | config/sarg/sarg.php | 4 | ||||
-rw-r--r-- | config/sarg/sarg.template | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc index 48f79917..e650efd6 100644 --- a/config/sarg/sarg.inc +++ b/config/sarg/sarg.inc @@ -103,17 +103,16 @@ function run_sarg($id=-1) { if ($action =="both" || $action=="rotate"){ log_error('executing squidguard log rotate after sarg.'); log_rotate($sarg_proxy['squidguard_block_log']); - log_error('executing squid log rotate after sarg.'); file_put_contents($sarg_proxy['squidguard_block_log'],"",LOCK_EX); chown($sarg_proxy['squidguard_block_log'],'proxy'); chgrp($sarg_proxy['squidguard_block_log'],'proxy'); - mwexec('squid -k reconfigure'); + mwexec('/usr/local/sbin/squid -k reconfigure'); } - break; + #leave this case without break to run squid rotate too. case "squid": if ($action =="both" || $action=="rotate"){ log_error('executing squid log rotate after sarg.'); - mwexec('squid -k rotate'); + mwexec('/usr/local/sbin/squid -k rotate'); } if ($action =="both" || $action=="restart"){ if (file_exists($sarg_proxy['squid_rc'])) @@ -140,7 +139,6 @@ function sync_package_sarg() { if (!preg_match("/\w+/",$_POST['__csrf_magic'])) return; } - $update_conf=0; #mount filesystem writeable conf_mount_rw(); @@ -166,6 +164,7 @@ function sync_package_sarg() { 'ldap_port'=> '389', 'ntlm_user_format'=>'domainname+username'); $sarguser=$config['installedpackages']['sarguser']['config'][0]; + $access_log=$sarg['proxy_server']; switch ($sarg['proxy_server']){ case 'dansguardian': $access_log= $sarg_proxy['dansguardian_log']; @@ -253,6 +252,7 @@ function sync_package_sarg() { if (!is_dir($dir)) mkdir ($dir,0755,true); + //log_error($_POST['__csrf_magic']." sarg log:". $access_log); #create sarg config files include("/usr/local/pkg/sarg.template"); file_put_contents("/usr/local/etc/sarg/sarg.conf", $sg, LOCK_EX); diff --git a/config/sarg/sarg.php b/config/sarg/sarg.php index c2ec00c2..98e6c426 100644 --- a/config/sarg/sarg.php +++ b/config/sarg/sarg.php @@ -39,6 +39,10 @@ require_once("/etc/inc/pkg-utils.inc"); require_once("/etc/inc/globals.inc"); require_once("/usr/local/pkg/sarg.inc"); +$uname=posix_uname(); +if ($uname['machine']=='amd64') + ini_set('memory_limit', '250M'); + if (preg_match ("/(\d+)/",$argv[1],$matches)) run_sarg($matches[1]); diff --git a/config/sarg/sarg.template b/config/sarg/sarg.template index 913dc892..affcdfc2 100644 --- a/config/sarg/sarg.template +++ b/config/sarg/sarg.template @@ -42,7 +42,7 @@ access_log {$access_log} # Use graphics where is possible. # graph_days_bytes_bar_color blue|green|yellow|orange|brown|red # -graphs ${graphs} +graphs {$graphs} #graph_days_bytes_bar_color orange # TAG: graph_font |