Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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 abehl@email.com Regards, Amit

Comment on Allocate a quota to users on a Linux system
Download Code
(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 | zdog7@hotmail.com

      Get a grip dude. Clearly this guy knows very little about the style in which he should probably write a post. That said, it is clear he is a newbie from a country where 'net access' isn't available to everyone. The arrogance of your post does nothing to promote the spread of information - someone gave you a break at some point I'm sure. If someone makes a mistake it's best to politley point that out otherwise just keep quite - right?
        Yikes,

        A post that is almost seven years old made by someone who has not logged on for two years. Well I guess things have moved on a lot since this post. These days people with moderation powers can move posts easily if they have been posted in the wrong section, Formatting can be added by janitors, normal users can 'consider' nodes for janitoring. Since the user claims not to have internet access, and requests that the solution be emailed to them, you have no way of proving that they did not get the answer sent to them. Many people take exception to requests to send people solutions via email, for various reasons. However this is one persons opinion of the post, and not necessarily that of the entire site/community

        Perhaps you should have a read at the PerlMonks Faq and How do I post a question effectively?

        Thanks

        Martin

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2014-07-10 17:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (214 votes), past polls