<div dir="ltr">Maybe there is a way to have an ssh server which will always run quota and exit before starting the user's shell?<div><br></div><div>That way SSHing into the server will never let a user do anything but knowing his quota.<br>
<br><div class="gmail_quote">On Mon, Jan 18, 2010 at 8:27 PM, Maxim Kovgan <span dir="ltr"><<a href="mailto:kovganm@gmail.com">kovganm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I think there is a problem to run the quota query from a web server,<br>
b/c the UID of the webserver process is not allowed to run quota stuff,<br>
and all the web technologies usually limit setuid() related stuff.<br>
And you don't want to run a CGI script as root, you really don't.<br>
<br>
So, the only relatively safe solution would be to build 2 scripts:<br>
1. script to generate the quota database, and it should run once per 1-5 minutes<br>
2. CGI/FastCGI/WSCGI script to query that database<br>
<br>
If users' repositories reside on the expense of their home<br>
directories, maybe a webmin/usermin web application allows to watch<br>
quota status with some nice module,<br>
<br>
SQLite looks like a good candidate, but even CSV is ok, as long as<br>
you make sure you use flock() like functions to lock the db file<br>
properly when you read/write, etc.<br>
<br>
<br>
Regards.<br>
<div><div></div><div class="h5"><br>
<br>
On Mon, Jan 18, 2010 at 4:07 PM, Maxim Kovgan <<a href="mailto:kovganm@gmail.com">kovganm@gmail.com</a>> wrote:<br>
> well, I'm not aware of anything ready to use, but there might be one -<br>
> a CGI/FastCGI or WSGI something.<br>
> you're interested in just showing quota command output with proper args.<br>
> If you choose Perl, you may use Quota;<br>
><br>
><br>
> On Mon, Jan 18, 2010 at 12:03 PM, Shahar Dag <<a href="mailto:dag@cs.technion.ac.il">dag@cs.technion.ac.il</a>> wrote:<br>
>> Max<br>
>><br>
>> Writing pre-commit script & writing a cron-job that test the quota are<br>
>> almost equal effort.<br>
>> I am not sure which one is better.<br>
>> What I am looking for is a tool that will enable the users check the quota<br>
>> on the svn machine<br>
>><br>
>> Shahar<br>
>><br>
>> ----- Original Message -----<br>
>> From: "Maxim Kovgan" <<a href="mailto:kovganm@gmail.com">kovganm@gmail.com</a>><br>
>> To: "Shahar Dag" <<a href="mailto:dag@cs.technion.ac.il">dag@cs.technion.ac.il</a>><br>
>> Cc: "Haifaux" <<a href="mailto:haifux@haifux.org">haifux@haifux.org</a>><br>
>> Sent: Monday, January 18, 2010 9:56 AM<br>
>> Subject: Re: [Haifux] SVN quota<br>
>><br>
>><br>
>>> hi Shahar!<br>
>>> A possible solution if your svn repository is stored on a filesystem could<br>
>>> be<br>
>>> a "pre-commit hook" script, that would basically:<br>
>>> * check user's/project's repository quota against filesystem<br>
>>> * act accordingly to the result, upon:<br>
>>> * OK - do commit<br>
>>> * Warning (quota threshold reached) - print the result, and commit<br>
>>> * Quota exceeded - print the result and NOT commit<br>
>>> Of course take care of the return values of the script properly.<br>
>>> The script may even send an email to the user, if you have email in NIS.<br>
>>><br>
>>> I do not know how different SVN clients would respond to the<br>
>>> non-standard messages in the output of SVN client.<br>
>>> This is what you will have to check for yourself.<br>
>>><br>
>>> Regards,<br>
>>> M.<br>
>>><br>
>>> 2010/1/18 Shahar Dag <<a href="mailto:dag@cs.technion.ac.il">dag@cs.technion.ac.il</a>>:<br>
>>>> Hello<br>
>>>><br>
>>>> I have a LINUX server (RHE 4) that among other things serves as SVN<br>
>>>> server<br>
>>>> (the SVN server runs over apache).<br>
>>>> Users can access their repository via https, but they can't login to the<br>
>>>> server (not even with ssh).<br>
>>>> To access the SVN, users must supply their NIS user name & password.<br>
>>>> Every SVN repository has it's own quota limitation.<br>
>>>><br>
>>>> The question is: do SVN users have any way to test their quota?<br>
>>>> (I don't want to write a cron job that warns the users when they are over<br>
>>>> 80% of the quota)<br>
>>>><br>
>>>> Thanks<br>
>>>> Shahar<br>
>>>> _______________________________________________<br>
>>>> Haifux mailing list<br>
>>>> <a href="mailto:Haifux@haifux.org">Haifux@haifux.org</a><br>
>>>> <a href="http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux" target="_blank">http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux</a><br>
>>>><br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Maxim Kovgan<br>
>>> _______________________________________________<br>
>>> Haifux mailing list<br>
>>> <a href="mailto:Haifux@haifux.org">Haifux@haifux.org</a><br>
>>> <a href="http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux" target="_blank">http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux</a><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> Haifux mailing list<br>
>> <a href="mailto:Haifux@haifux.org">Haifux@haifux.org</a><br>
>> <a href="http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux" target="_blank">http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Maxim Kovgan<br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Maxim Kovgan<br>
_______________________________________________<br>
Haifux mailing list<br>
<a href="mailto:Haifux@haifux.org">Haifux@haifux.org</a><br>
<a href="http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux" target="_blank">http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux</a><br>
</div></div></blockquote></div><br></div></div>