Date: Sun, 12 Apr 1998 02:18:09 -0700 From: "Jordan K. Hubbard" <jkh@time.cdrom.com> To: committers@FreeBSD.ORG Subject: Craig Leres: problems with cron and FreeBSD login classes Message-ID: <28136.892372689@time.cdrom.com>
index | next in thread | raw e-mail
Any comments?
------- Forwarded Message
To: vixie@vix.com (Paul Vixie)
Cc: jkh@freebsd.org (Jordan K. Hubbard), jef@ee.lbl.gov (Jef Poskanzer)
Subject: problems with cron and FreeBSD login classes
Date: Sun, 12 Apr 1998 02:15:02 PDT
From: Craig Leres <leres@ee.lbl.gov>
We upgraded our netnews server to a Pentium II running FreeBSD
2.2.5-STABLE a few months ago. Ignoring our difficulties with innfeed,
the one remaining problem was that the weekly news cron job to rebuild
the history file didn't work; that is, it worked from an interactive
shell but when run from cron, it all but ground to a stop using a tiny
amount of cpu, never reaching completion.
I traced the problem to the new /etc/login.conf stuff in FreeBSD. The
main problem seemed to be that the version of cron I had didn't know
about login classes. I picked up some changes from the FreeBSD-current
source tree but they were less than satisfactory... It looks like that
version expects you to put the login class after the user name,
delimited by a slash, e.g.:
0 * * * * news/news /usr/news/bin/news.hourly
The user is news and the login class is news. Anyway, this seems silly
to me; you've already got the login class in the password file, why not
use it instead of replicating this info in the crontab file?
Appended is the minimal patch I made to cron/do_command.c. The idea is
to use the login class from the password file; if there isn't one in
the password file, use RESOURCE_RC (daemon). Does this change look
reasonable? Should the default just be the "default" login class?
Should it be possible to override the login class in the crontab? Let
me know what sounds reasonable and I'll submit a more complete patch.
Craig
- ------
*** /tmp/,RCSt1016462 Sun Apr 12 02:03:54 1998
- --- do_command.c Sun Apr 12 02:03:43 1998
***************
*** 229,236 ****
lc = NULL;
if (pwd != NULL) {
pwd->pw_gid = e->gid;
! if (e->class != NULL)
! lc = login_getclass(e->class);
}
if (pwd &&
setusercontext(lc, pwd, e->uid,
- --- 229,238 ----
lc = NULL;
if (pwd != NULL) {
pwd->pw_gid = e->gid;
! if (pwd->pw_class == NULL)
! lc = login_getclass(RESOURCE_RC);
! else
! lc = login_getpwclass(pwd);
}
if (pwd &&
setusercontext(lc, pwd, e->uid,
------- End of Forwarded Message
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?28136.892372689>
