aboutsummaryrefslogtreecommitdiffstats
path: root/config/sarg
diff options
context:
space:
mode:
Diffstat (limited to 'config/sarg')
-rw-r--r--config/sarg/sarg.inc10
-rw-r--r--config/sarg/sarg.php4
-rw-r--r--config/sarg/sarg.template2
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