#1  
Old 15th September 2011, 16:12
ircf ircf is offline
Junior Member
 
Join Date: Feb 2011
Posts: 22
Thanks: 3
Thanked 5 Times in 4 Posts
Default Incorrect FTP quota

Hello,

I have installed ISP Config 3.0.3 on Squeeze Debian and PureFtp shows incorrect quota usage on logging :
Code:
Commande :	USER test
Réponse :	331 User test OK. Password required
Commande :	PASS ********
Réponse :	230-User test has group access to:  client1    sshusers  
Réponse :	230-OK. Current restricted directory is /
Réponse :	230 515869 Kbytes used (50%) - authorized: 1024000 Kb

--

du -sh /var/www/clients/client1/web1/
63M	/var/www/clients/client1/web1/

--

ls -la /var/www/test.com/

drwxr-x--x   6 web1 client1   200 26 févr.  2011 .
drwxr-xr-x 176 root root    10536 15 sept. 09:40 ..
drwxr-x--x   2 web1 client1    48 12 févr.  2011 cgi-bin
-rwxr-xr-x   1 root root       40 26 févr.  2011 .htpasswd_stats
lrwxrwxrwx   1 web1 client1    38 12 févr.  2011 log -> /var/log/ispconfig/httpd/test.com
drwxr-x--x   2 web1 client1    48 12 févr.  2011 ssl
drwxrwxrwx   2 web1 client1    48 12 févr.  2011 tmp
drwx--x---   4 web1 client1   128 12 févr.  2011 web

User name and website host have been change for obvious reasons...

Any idea where I should start debugging this please ?
Reply With Quote
Sponsored Links
  #2  
Old 15th September 2011, 17:43
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,581
Thanks: 792
Thanked 4,980 Times in 3,901 Posts
Default

Why are you so sure that the quota usage is incorrect? The Quota for a FTP User is the quota of the web[ID] linux user, if the quota is not set separately for this FTP user in the ftp user settings. So if you want to check if the quota is correct, run the command:

repquota -avu | grep web1

And you should update your ispconfig version, 3.0.3 is quite old, the current version is 3.0.3.3
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 15th September 2011, 18:07
ircf ircf is offline
Junior Member
 
Join Date: Feb 2011
Posts: 22
Thanks: 3
Thanked 5 Times in 4 Posts
Default Weirder...

Mmm... This is getting weirder and weirder...

I checked the quota and here is what I got :

Code:
repquota -avu | grep web1

Période de sursis bloc : 7days ; période de sursis inode : 7days
                        Block limits                File limits
Utilisateur     utilisé souple stricte sursis utilisé souple stricte sursis
----------------------------------------------------------------------
web1     --       0  512000  513024              0     0     0
I pasted the table header to make it more comprehensive...

Indeed, this morning, the quota was 500MB, I passed it to 1GB when I noticed it was "full". I ran several time :

Code:
quotaoff -avug
quotacheck -avugm
quotaon -avug
But this make no difference... Here are my questions :

1- Is it normal that quota here is 500MB while PureFtp shows 1GB ?
2- Is it normal that usage here is 0 while PureFtp shows 512MB ?
3- If usage really is 512MB, where could I find (and destroy) the (useless) files ? Because my website is only 63MB... I mean the user home dir is 63MB, how could it have written so much files outside of his home ? (this is a tiny website, not very popular...)

Thank you for your precious time Till, you do a really great job !

PS : I'll upgrade ASAP, unfortunately this is not so easy because I had to make some hacks... I don't think this problem is really related with ISP Config anyway, or is it ?

Last edited by ircf; 15th September 2011 at 18:11.
Reply With Quote
  #4  
Old 21st September 2011, 18:17
ircf ircf is offline
Junior Member
 
Join Date: Feb 2011
Posts: 22
Thanks: 3
Thanked 5 Times in 4 Posts
Default Solution and last question...

Hi again

I got a solution to this problem, the .ftpquota file in /var/www/test.com was not up-to-date. I ran this command to fix it :

Code:
pure-quotacheck -u web1 -d /var/www/test.com
I have looked in ISP Config cron daily but I didn't see it...

I suppose I have to add a line in my crontab to update ftpquota files on a regular basis, is that alright ?

Thank you for your support.
Reply With Quote
  #5  
Old 21st September 2011, 21:50
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,581
Thanks: 792
Thanked 4,980 Times in 3,901 Posts
Default

ISPConfig does not use nor create a file called .ftpquota in the website. So this file must have been added by a different software and thats also the reason why its not updated by ispconfig.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 25th October 2011, 10:28
ircf ircf is offline
Junior Member
 
Join Date: Feb 2011
Posts: 22
Thanks: 3
Thanked 5 Times in 4 Posts
Default Integrate pure-quotackeck in ISPConfig ?

Hello again,

I couldn't find a solution to automate pure-quotacheck on each user dir so I added this script to my ISP Config cron_daily.php (right before the die("finished"); line) :

Code:
#######################################################################################################
// Check quotas for Pure FTP
#######################################################################################################

$sql = "SELECT document_root, system_user FROM web_domain WHERE server_id = ".$conf['server_id'];
$records = $app->db->queryAllRecords($sql);
$app->uses('system');
if(is_array($records)) {
        foreach($records as $rec){
                $web_path = realpath(escapeshellcmd($rec['document_root']));
                $web_user = $rec['system_user'];
                if($web_path != '' && strlen($web_path) > 10 && is_dir($web_path) && $app->system->is_user($web_user)){
                        //echo "/usr/sbin/pure-quotacheck -u $web_user -d $web_path\n";
                        exec("/usr/sbin/pure-quotacheck -u $web_user -d $web_path");
                }
        }
}
I just copied/pasted the "clear tmp dir" section and replaced some code.

That could be a good thing to add a test to ensure system uses pure-ftp and maybe add this script to the official cron_daily.php ?

Because without this, FTP quotas with pure-ftp just won't be updated (and won't work), or maybe there is another way to handle FTP quotas with pure FTP in ISP Config ?

Thank you.
Reply With Quote
The Following User Says Thank You to ircf For This Useful Post:
till (25th October 2011)
  #7  
Old 25th October 2011, 11:34
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,581
Thanks: 792
Thanked 4,980 Times in 3,901 Posts
 
Default

ISPConfig uses Linux system quotas for websites and not pure-ftpd quotas. Linux system quotas are handled by the filesystem automatically and are configured in /etc/fstab. They are used for ftp and ssh users, linux system quotas dont have to be updated manually with pure-quotacheck.

ISPConfig does not use a file called .ftpquota in its default install, so there is no need to update that from ispconfig side. If you use a different setup though, then you might have to use your own scripts.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
ftp, pureftp, quota

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron issue in Debian 6 Nolan Installation/Configuration 6 18th April 2011 16:36
Troubleshooting FTP bswinnerton Installation/Configuration 4 10th October 2008 19:34
proFTPd passive mode problems bisbell Server Operation 8 6th August 2008 21:12
Question about Virtual Hosting With Proftpd And MySQL (Incl. Quota) On Debian Etch ikkem HOWTO-Related Questions 30 26th February 2008 19:38
Website users? ctroyp General 25 6th January 2006 18:02


All times are GMT +2. The time now is 15:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.