From owner-cvs-all Sun Apr 12 02:18:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA08695 for cvs-all-outgoing; Sun, 12 Apr 1998 02:18:00 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from time.cdrom.com (root@time.cdrom.com [204.216.27.226]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA08683 for ; Sun, 12 Apr 1998 02:17:58 -0700 (PDT) (envelope-from jkh@time.cdrom.com) Received: from time.cdrom.com (jkh@localhost.cdrom.com [127.0.0.1]) by time.cdrom.com (8.8.8/8.8.8) with ESMTP id CAA28140 for ; Sun, 12 Apr 1998 02:18:09 -0700 (PDT) (envelope-from jkh@time.cdrom.com) To: committers@FreeBSD.ORG Subject: Craig Leres: problems with cron and FreeBSD login classes Date: Sun, 12 Apr 1998 02:18:09 -0700 Message-ID: <28136.892372689@time.cdrom.com> From: "Jordan K. Hubbard" Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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 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