This post refers to OSF/1 v3.0.
I'm trying to set disk quotas for my users using quotactl(), but I'm finding
that if I do:
...
struct passwd *pw;
struct group *gr;
struct dqblk q;
gr = getgrnam("customer");
if (gr == (struct group *)NULL) {
fprintf(stderr,"Group \"customer\" not defined.\n");
return(1);
}
setpwent();
while ( (pw = getpwent()) != (struct passwd *)NULL ) {
if (pw->pw_gid == gr->gr_gid) { /* if it's the right group */
(void) memset ((char *)&q,'\0',sizeof(q));
q.dqb_bsoftlimit = 2000;
q.dqb_bhardlimit = 10000;
q.dqb_btime = 3*86400; /* 3 days */
fprintf(stdout,"Setting quota for %s\n",pw->pw_name);
if (quotactl(pw->pw_dir,QCMD(Q_SETQUOTA,USRQUOTA),
pw->pw_uid,&q) < 0)
fprintf(stdout,"quotactl(Q_SETQUOTA): %s\n",
strerror(errno));
}
}
...
It's setting the two quotas correctly, but the grace period that shows
up as output on "quota -v" for someone over quota, either their soft
limit or their hard limit, says "none", and the user is denied more
blocks. Am I doing something wrong?
--
Murray S. Kucherawy ==========================================================
Software Manager HookUp Communication Corporation - Ontario, CANADA
--- "Intel, where quality is job 0.9999992342" ---