Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Allocate a quota to users on a Linux system

by Anonymous Monk
on Aug 19, 2000 at 13:23 UTC ( #28631=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I have been working on and off on Perl, for a year. My project guide at college asked me to create users on the Linux server, from a flatfile, ie provided at runtime and allocate quota's on the mailbox size only. Well i configured my /var/spool/mail, enabled it to be enabled for user quotas. My script creates users, but does not allocate the user any quota. How do i use the quota cmd, and force the quota onto the user(s) created?? Pls help. I am using the foll code:
sub set_new_quota { #user,blocks local ($SYS_quota)=148; local ($Q_SETDLIM)=3; local ($uid,$bs) = @_ ; local ($dir) = "/var/spool/mail\0"; local ($dqblk) = pack("LLLLLLLL",10000,$bs,0,1000,200,0,0,0); local ($stat,$buf); $stat=syscall($SYS_quota,$Q_SETDLIM,$dir,$uid+0,$dqblk); return $stat==0; }
and it won't do as is desired of it. Please help at the earliest, please. I am not having net access. Could u please send me a reply at Regards, Amit

Replies are listed 'Best First'.
(zdog) RE: Bad Post?
by zdog (Priest) on Aug 19, 2000 at 20:51 UTC
    This post bothers me for several reasons:

    - It is poorly formatted. Ya, I know what you are saying. He is a newbie and you can't correct root posts. But when I was a newbie, I used the preview button, and figured out that I needed HTML tags to make it look nice.

    - Secondly, questions such as this go into Seekers of Perl Wisdom, not Perl Monks Discussion.

    - Finally, I find it somewhat insulting to the PerlMonks community that he comes here with a question and can't even com back for the answer, but needs it e-mailed to him. If I knew the answer, I wouldn't.

    I feel that when people vote --, they should post what is wrong with it unless it is already posted, so this post was just to back up that feeling. (Although in this particular case, voting on Anonymous Monk doesn't really matter, but that is beside the point.)

    Zenon Zabinski | zdog |

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://28631]
Approved by rob_au
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2020-09-29 21:51 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (153 votes). Check out past polls.