[imp] Quota driver Command

mtecles at biof.ufrj.br mtecles at biof.ufrj.br
Mon Jul 18 21:42:32 UTC 2011


On 6 Jul 2011 at 13:06, Eric Jon Rostetter wrote:

> Quoting mtecles at biof.ufrj.br:
> 
> > Problem 1.
> > The use of volumes generates long names for the partitions, wich
> > wraps the response line of the quota command (Debian 6). As the
> > result, IMP displays "No limit". Horde logs:
> 
> Known, problem, discussed before on the mailing lists.
> 
> > Use "quota -uw" in the function getQuota. That is:
> 
> Not portable.  There are various solutions for various installations,
> but they are not portable.
> 
> You can define "quota_path" to include the switch, I believe...  That is,
> define "quota_path" to be something like "/usr/bin/quota -w" in order
> to get the desired effect.
> 

You are right, defining "quota_path" to "/usr/bin/quota -w" solves 
problem 1, on Debian.
Thank you.

> > Problem 2.
> > Command drive fails to determine the disk block size and IMP displays
> > wrong numbers. Using
> > $blocksize = 1024;
> > solved the problem for me.
> 
> We try to get the correct block size in the function blockSize() and
> if not, we default to 1024.
> 
> Can you debug why the function is failing to get the correct block size
> and also failing to use the default?  Per the docs, it is known to be
> problematic, ala:
> 
>       * We try to find out the disk block size from stat(). If not
>       * available, stat() should return -1 for this value, in which
>       * case we default to 1024 (for historical reasons). There are a
>       * large number of reasons this may fail, such as OS support,
>       * SELinux interference, the file being > 2 GB in size, the file
>       * we're referring to not being readable, etc.
> 
> I'm not sure why this would fail in your case -- it works in my install.
> 

It does not fail to use the default. In Command.php, changing 
"stat(__FILE__)" for "stat("x")" causes an error and it uses the 
default (1024):

WARN: HORDE [imp] PHP ERROR: stat(): stat failed for x [pid 6892 on 
line 59 of "/var/www/horde/imp/lib/Quota/Command.php"]

For user test:
# quota -su test
Disk quotas for user test (uid 1001):
     Filesystem   space   quota   limit   grace   files   quota   
limit   grace
/dev/disk/by-uuid/734e96a4-af8f-4c83-a12c-4ab11b139a13
                 64572K  100000K    118M              11       0      
 0
# quota -u test
Disk quotas for user test (uid 1001):
     Filesystem  blocks   quota   limit   grace   files   quota   
limit   grace
/dev/disk/by-uuid/734e96a4-af8f-4c83-a12c-4ab11b139a13
                  64572  100000  120000              11       0       
0
So, the unit for quota is K(1024).
Using "stat(__FILE__)" IMP shows: 65% of 391MB.
Using "stat("x")" IMP shows: 65% of 98MB, which is right.

It turns out that "stat(__FILE__)" returns 4096, somehow (Debain 6.0, 
Squeeze). I could not find out why.

I just fixed "blocksize" to 1024.

Thank you,
Mauricio

> > Mauricio
> 
> -- 
> Eric Rostetter
> The Department of Physics
> The University of Texas at Austin
> 
> This message is provided "AS IS" without warranty of any kind,
> either expressed or implied.  Use this message at your own risk.


--------------------------------------------------------
Mauricio J. T. Tecles
Instituto de Biofísica Carlos Chagas Filho - UFRJ
Edifício do Centro de Ciências da Saúde, Bloco G
Av. Carlos Chagas Filho, 373
Cidade Universitária, Ilha do Fundão
Rio de Janeiro, RJ
Brasil
21941-902
Telefone: 55 21 2562-6544
FAX: 55 21 2280-8193
mtecles at biof.ufrj.br



More information about the imp mailing list