From nobody@FreeBSD.org  Fri Mar 11 18:33:35 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8ED08106567B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Mar 2011 18:33:35 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 7D6508FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Mar 2011 18:33:35 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p2BIXYY3086235
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Mar 2011 18:33:34 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p2BIXYka086216;
	Fri, 11 Mar 2011 18:33:34 GMT
	(envelope-from nobody)
Message-Id: <201103111833.p2BIXYka086216@red.freebsd.org>
Date: Fri, 11 Mar 2011 18:33:34 GMT
From: Alex Keda <admin@lissyara.su>
To: freebsd-gnats-submit@FreeBSD.org
Subject: login.conf: maxproc does not work when command running from cron
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         155480
>Category:       conf
>Synopsis:       [login.conf] maxproc does not work when command running from cron
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 11 18:40:05 UTC 2011
>Closed-Date:    
>Last-Modified:  Fri Mar 11 21:54:03 UTC 2011
>Originator:     Alex Keda
>Release:        8.2-RELEASE
>Organization:
USSR
>Environment:
FreeBSD srv2.host-food.ru 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Tue Mar  1 21:17:04 MSK 2011     lissyara@srv10.host-food.ru:/home/usr_moved/obj/home/usr_moved/src/sys/HOST-FOOD  amd64

>Description:
I create login class:
lissyara# grep id100 --after-context=7 /etc/login.conf
id100:\
        :coredumpsize=1:\
        :cputime=60s:\
        :maxproc=12:\
        :openfiles=32:\
        :priority=20:\
        :tc=default:

lissyara#

then, run command:

lissyara# cap_mkdb -v /etc/login.conf
cap_mkdb: 10 capability records
lissyara#

add user:

lissyara# grep ^test1234 /etc/master.passwd
test1234:$1$kj/WOTuN$vLGcOBPv9ro8eljOe.ChA1:1002:1004:id100:0:0:User &:/home/test1234:/bin/sh
lissyara#

add cron job for user:

lissyara# crontab -l -u test1234
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
* * * * * /bin/sleep 72000
lissyara#

after some time I see lot sleep processes in ps output

lissyara# ps -auxww | grep ^test1234 | grep sleep | wc -l
     130
lissyara#

130 > 12

========
If I running commands from ssh session - all OK, I cannot run more than
maxproc processes...

http://lists.freebsd.org/pipermail/freebsd-current/2011-March/023234.html

It's very serious problem - for shared hostings servers and such other
applications where users have access to create cron jobs
>How-To-Repeat:
see full desc
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
