IMP Quota command driver, was Re: [dev] Bounties

Eric Rostetter eric.rostetter at physics.utexas.edu
Thu Jun 24 15:28:10 PDT 2004


Quoting Etienne Goyer <etienne.goyer at linuxquebec.com>:

> On Fri, Jan 30, 2004 at 04:50:08PM -0600, Eric Rostetter wrote:
>> > I prefer 1 for reasons I will explain below.
>>
>> I prefer a third option.  Locating the proper home directory and use the
>> quotas on that device.
>
> Outside of getting the pwnam home dir entry, and then parsing the output
> of mount looking for the partition that house this directory, I don't
> see how to do that.  And even that would be really flaky as the output
> of mount(8) is OS/version dependant.

I've just done a CVS commit to the HEAD branch off accounts to do just this.
It requires configuration, and it requires the PEAR module File_Fstab.

Things yet to do:

* Handle the case where the quota output wraps onto two lines.
* Update the conf.xml file to allow the proper configuration of the above
   code (right now you would have to configure your conf.php by hand).

>> > My fix, BTW, is completely backward-compatible so it
>> > will not affect those for whom the driver currently work.

I asked for a resubmission of this patch, and never got it, so I've started
my own fix.  Anyone who wants to help (with conf.xml, docs, or the quota
output line wrap issue) feel free to join in with ideas.

> No, it would.  Have you read the code ?  I coded it with
> backward-compatibility in mind.  You don't even have to change your
> config.  If the 'new_quota'(*) param is not set, it behave as it does
> currently.

I took a different approach, with a flag to say you want mount point
translations, and then another parameter which specifies the file to
use to translate it (On linux, you can use either /etc/fstab or /etc/mtab.
On solaris, you might use /etc/vfstab, or maybe /etc/mnttab?  And so on...)

>> > wait until someone come up with a general solution, which may never
>> > happen.  I don't have the commit bit so I'll leave the decision to
>> > whoever is responsible.
>>
>> Or, keep working on it.  Keep asking for help on the list, etc.  Eventually
>> we'll get there.  I'd do it, but I just plain don't have the time right
>> now...

Well, using the PEAR File_Fstab class seems like a reasonable way to handle
this to me.  Others should feel free to contest that if they feel the need.

> No.  I'm out of here.  I already spent wayyyyyy too much time on this,
> and I can see no end to it if I have to accomodate every convulated
> quota setup possible.

Just trying to cover the 3 most common setups:

1) The quota command returns the login directory name.
2) The quota command returns the device name of the login directory.
3) The quota command wraps the output onto multiple lines (e.g. home dir/dev
    on one line, quota info on the next line).

Still don't have #3 solved yet (but may soon, who knows?)

> --
> Etienne Goyer                    Linux Québec Technologies Inc.
> http://www.LinuxQuebec.com       etienne.goyer at linuxquebec.com

--
Eric Rostetter
The Department of Physics
The University of Texas at Austin

Why get even? Get odd!



More information about the dev mailing list