Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

squish - quota resetting time

Posted on 2009-02-16
18
Medium Priority
?
2,552 Views
Last Modified: 2013-12-16
I am using Squid on Fedora Core 8 with Squish. Everything is working fine with user authentication and quotas. Only problem is if some user exceeds the daily quota and gets squished. Squish resets the quota only at 12pm the following day. Hence, the users are blacked out from internet for almost half the working day.

I need to reconfigure Squish to reset the quotas at 6am instead of 12pm. Could you plz help me with this.

0
Comment
Question by:rajasekarramasamy
  • 10
  • 8
18 Comments
 
LVL 23

Assisted Solution

by:Maciej S
Maciej S earned 2000 total points
ID: 23649114
There is probably some cronjob, which is run at 12pm which zeros users' quotas. Change this to 6am, and that's all.
0
 

Author Comment

by:rajasekarramasamy
ID: 23649223
Only one cron file is there in squish "/usr/local/squish/squish.cron.sh. Kindly mention mention the exact location of the cron file and where should i change the time.
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 23649752
I'm sorry - I've downloaded squish sources, and it's probably cron unrelated.
It looks, that squish just parses squid logfiles and blocks users automatically. Cron is just for parsing squid logfiles (every 5 minutes by default).
Strange part is what you are saying about quota resetting at 12pm - it should be IMHO at 12am. Do you have proper time/timezone set on your server? Does the squid/squish uses this time/timezone setting, or does it change locally (ie. in squid init script)?
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 

Author Comment

by:rajasekarramasamy
ID: 23657830
Ok. I am having another doubt.

Users can able to continue  the downloading files after the quota exceeds but they not able to browse. After the current download completed they not able to download or browse the net. The main problem is if the user download any large files means (eg 1GB file) after the quota execeeds also downloading files are not terminated it still continue.

Is there any settings  in squish to terminate the download once the quota exceeds.
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 23657876
This is one of the issues with squish - user can start downloading some big file, and even if he reaches his/her quota during this download, he/she can successfully download it to the end.

From squish FAQ (http://www.ledge.co.za/software/squint/squish/FAQ):
Q.  Can I download a file bigger than my daily quota?
A.  Just do it.  You'll get squished when the download completes, but don't
    worry about that.  Being squished does not affect downloads currently in
    progress, unless the connection is interrupted.
0
 

Author Comment

by:rajasekarramasamy
ID: 23657918
Hi oklit,

1) Is there any other way to stop the download?
2) Is there any other software like squish for quota management using with squid?
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 23658046
1. Theoretically you can interrupt downloads every x minutes, so that user has to renew downloading - but it can be very annoying for users (even if they can renew transfers from the moment that transfers were interrupted). I wouldn't do that.

2. I found two more, but I know nothing about them, so you should try them by yourself:
http://sourceforge.net/projects/alfred/
http://sourceforge.net/projects/quotasquid/
0
 

Author Comment

by:rajasekarramasamy
ID: 23658150
In Both the link i am not able to download packages. Kindly check it.

http://sourceforge.net/projects/alfred/
http://sourceforge.net/projects/quotasquid/
0
 
LVL 23

Assisted Solution

by:Maciej S
Maciej S earned 2000 total points
ID: 23658420
I tried to download both - just downloaded first one (alfred). Unfortunately, I can't download quotasquid - there are no files at sourceforge :/ I can't find it with google also. So - this is probably dead project.
As for alfred, try one of these:
http://mesh.dl.sourceforge.net/sourceforge/alfred/auth_mod.tar.gz
http://voxel.dl.sourceforge.net/sourceforge/alfred/auth_mod.tar.gz
http://transact.dl.sourceforge.net/sourceforge/alfred/auth_mod.tar.gz

But - I read more than just entry message about alfred. Although there was information that "Alfred, OpenSource Internet Software, is a collection of utilities that bring Quota support to SQUID.", it looks, that it's not you were looking for - it's probably some netware module to authenticate users :(

So, I'm afraid you have no other option - just squish.
0
 

Author Comment

by:rajasekarramasamy
ID: 23658780
Ok. This the last doubt. I have configure delay pool in squid to restrict download speed for particular file extension like .exe, .iso etc... I have restrict download speed by using the LDAP user name.  Delay pool is working fine. The problem is when the squish quota exceeds the delay pool is not working. Users can able to download files at full speed. If the quota not execeeds means delay pool working fine.

Kindly see my squid code

acl ldapauth proxy_auth REQUIRED
acl SQUISHLOC dst adminlinux
 acl SQUISHED1 proxy_auth -i "/etc/squid/squished"
# acl SQUISHED2 ident    "/etc/squid/squished"
acl SQUISHED3 src        "/etc/squid/squished"
# Error info that says you're squished
#deny_info ERR_QUOTA_EXCEEDED SQUISHED1
deny_info http://192.168.1.14/squish/?squished& SQUISHED1
# deny_info http://adminlinux/squish/?squished& SQUISHED2
#deny_info ERR_QUOTA_EXCEEDED SQUISHED3
deny_info http://192.168.1.14/squish/?squished& SQUISHED3
# HTTP access controls for squish
http_access allow SQUISHLOC
 http_access deny SQUISHED1
# http_access deny SQUISHED2
http_access deny SQUISHED3

delay_pools 1
delay_class 1 1
delay_parameters 1 1000/1000
acl our_networks src 192.168.1.0/24  
acl DelayDownload url_regex -i "/etc/delaydownload"
delay_access 1 allow DelayDownload
http_access allow ldapauth !SQUISHED1
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 23679677
So, if user reaches his/her quota he/she is able to download anything? That would mean, that squish doesn't work at all - such user should not be able to download anything, right?
0
 

Author Comment

by:rajasekarramasamy
ID: 23679757
<<<<<<So, if user reaches his/her quota he/she is able to download anything?

If user's reaches his quota he can able to download files at full speed. If user's quota not reaches means user can able to download files with 1.5 kbps speed.








That would mean, that squish doesn't work at all - such user should not be able to download anything, right?
0
 

Author Comment

by:rajasekarramasamy
ID: 23679768
<<<<<<So, if user reaches his/her quota he/she is able to download anything?

If user's reaches his quota he can able to download files at full speed. If user's quota not reaches means user can able to download files with 1.5 kbps speed.


<<<<<<That would mean, that squish doesn't work at all - such user should not be able to download anything, right?

such users can able to download files @ full speed.
0
 
LVL 23

Expert Comment

by:Maciej S
ID: 23751106
I'm afraid I don't know why this happens.
I see, that you asked this as separate question and got answer (about turning on debugging) from Nopius. If you can write here what was causing this, it can be helpful for others :)
0
 

Accepted Solution

by:
rajasekarramasamy earned 0 total points
ID: 24535570
Hi oklit

I found a solution to reset the squish quota manually.

This is my solution.

1)      After installing squish. Copy this file userdb.stor  from /var/lib/squish/ to /backup
2)      Turn off the squid auto start by using this command chkconfig squid off
3)      Add the below lines to a shell script file and execute the shell script at a specific time using cron

/etc/init.d/squid stop                                #Stop the squid proxy
rm /var/log/squid/access.log                  #Removing access.log file.
rm /var/lib/squish/userdb.stor                  #Removing squish user quota file
cp /backup/userdb.stor /var/lib/squish/      #Copying   userdb.stor  to squish quota directory.
/usr/sbin/squid                              #Start the squid now

0
 
LVL 23

Expert Comment

by:Maciej S
ID: 24545273
Oh.. of course! I should come up with this earlier :) As squish looks at squid logs, the easiest way is to rotate squid logs :) It couldn't be simpler ;) Great you have it solved.
0
 

Author Comment

by:rajasekarramasamy
ID: 24553481
Hi oklit,

Without deleting the squish quota file there is no use. We need to delete squish quota file & squid log file.
0
 

Author Comment

by:rajasekarramasamy
ID: 25333617
I found solution by my self.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question