aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-05-03 19:15:00 -0300
committermarcelloc <marcellocoutinho@gmail.com>2012-05-03 19:15:00 -0300
commit08e2b2389dd192eaacc637fbbb97aa287de8ad0f (patch)
tree1d6644b075a24858f0288bf2329358117899c816
parentba95ea5d0906caff833b962fa062d4a35d2bd48d (diff)
downloadpfsense-packages-08e2b2389dd192eaacc637fbbb97aa287de8ad0f.tar.gz
pfsense-packages-08e2b2389dd192eaacc637fbbb97aa287de8ad0f.tar.bz2
pfsense-packages-08e2b2389dd192eaacc637fbbb97aa287de8ad0f.zip
sarg - reduce boot process and include startup check
-rw-r--r--config/sarg/sarg.inc20
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
3 files changed, 20 insertions, 4 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc
index e762d9b8..48f79917 100644
--- a/config/sarg/sarg.inc
+++ b/config/sarg/sarg.inc
@@ -32,6 +32,10 @@
*/
/* ========================================================================== */
+$uname=posix_uname();
+if ($uname['machine']=='amd64')
+ ini_set('memory_limit', '250M');
+
// STATIC VARS
$sarg_proxy=array( 'squid_rc'=>'/usr/local/etc/rc.d/squid.sh',
'squid_config'=>'/var/squid/logs/access.log',
@@ -99,8 +103,13 @@ 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');
}
- #Leve this case without break to include squid log file on squidguard option
+ break;
case "squid":
if ($action =="both" || $action=="rotate"){
log_error('executing squid log rotate after sarg.');
@@ -125,6 +134,13 @@ function run_sarg($id=-1) {
function sync_package_sarg() {
global $config, $g,$sarg_proxy;
+
+ # detect boot process
+ if (is_array($_POST)){
+ if (!preg_match("/\w+/",$_POST['__csrf_magic']))
+ return;
+ }
+
$update_conf=0;
#mount filesystem writeable
conf_mount_rw();
@@ -168,7 +184,7 @@ function sync_package_sarg() {
$access_log = $config['installedpackages']['squid']['config'][0]['log_dir']. '/access.log';
break;
}
- if (!file_exists($access_log)){
+ if (!file_exists($access_log) && $access_log !=""){
$error="Sarg config error: ".$sarg['proxy_server']." log file ($access_log) does not exists";
log_error($error);
file_notice("Sarg", $error, "Sarg Settings", "");
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 3254829b..26d07320 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -552,7 +552,7 @@
<pkginfolink>http://forum.pfsense.org/index.php/topic,47765.0.html</pkginfolink>
<depends_on_package_base_url>http://e-sac.siteseguro.ws/packages/8/All/</depends_on_package_base_url>
<depends_on_package>sarg-2.3.2.tbz</depends_on_package>
- <version>2.3.2 pkg v.0.4.1</version>
+ <version>2.3.2 pkg v.0.4.2</version>
<status>beta</status>
<required_version>2.0</required_version>
<configurationfile>sarg.xml</configurationfile>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 01d6bdac..17456ae1 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -638,7 +638,7 @@
<pkginfolink>http://forum.pfsense.org/index.php/topic,47765.0.html</pkginfolink>
<depends_on_package_base_url>http://e-sac.siteseguro.ws/packages/amd64/8/All/</depends_on_package_base_url>
<depends_on_package>sarg-2.3.2.tbz</depends_on_package>
- <version>2.3.2 pkg v.0.4.1</version>
+ <version>2.3.2 pkg v.0.4.2</version>
<status>beta</status>
<required_version>2.0</required_version>
<configurationfile>sarg.xml</configurationfile>