J
John Call
I am trying to write a small script that will change quotas for me on a
RedHat box. The following is my program (99% of which comes from the book
Perl for System Administration).
-----------
#!/usr/bin/perl
use Quota;
$filesystem = '/home/users/<username>';
$soft = 5;
$hard = 6;
$isoft = 0;
$ihard = 0;
my($name,$paswd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell ) =
getpwnam($ARGV[0]);
$dev = Quota::getqcarg($filesystem);
($curblock, $soft, $hard, $curinode, $btimeout, $curinode, $isoft, $ihard,
$itim
eout) = Quota::query($dev, $uid) or die "Unable to query quota for
$uid:$!\n";
Quota::setqlim($dev, $uid, $soft, $hard, $isoft, $ihard, 1) or die "Unable
to set quotas:$!\n";
---------------
Quota::query returns the following error:
Unable to query quota for 2977:No such process
If I REM out the Quota::query line, Quota::setqlim returns the following
error:
Unable to set quotas:No such file or directory
I'm really not sure why this is happening. I checked the errata page for the
book and found no errors for this section. I also check Google groups and
found nothing.
Any help appreciated.
Thanks,
John
RedHat box. The following is my program (99% of which comes from the book
Perl for System Administration).
-----------
#!/usr/bin/perl
use Quota;
$filesystem = '/home/users/<username>';
$soft = 5;
$hard = 6;
$isoft = 0;
$ihard = 0;
my($name,$paswd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell ) =
getpwnam($ARGV[0]);
$dev = Quota::getqcarg($filesystem);
($curblock, $soft, $hard, $curinode, $btimeout, $curinode, $isoft, $ihard,
$itim
eout) = Quota::query($dev, $uid) or die "Unable to query quota for
$uid:$!\n";
Quota::setqlim($dev, $uid, $soft, $hard, $isoft, $ihard, 1) or die "Unable
to set quotas:$!\n";
---------------
Quota::query returns the following error:
Unable to query quota for 2977:No such process
If I REM out the Quota::query line, Quota::setqlim returns the following
error:
Unable to set quotas:No such file or directory
I'm really not sure why this is happening. I checked the errata page for the
book and found no errors for this section. I also check Google groups and
found nothing.
Any help appreciated.
Thanks,
John