From owner-freebsd-questions@FreeBSD.ORG Sat May 16 17:27:27 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 857DA10656C0 for ; Sat, 16 May 2009 17:27:27 +0000 (UTC) (envelope-from kirk@strauser.com) Received: from kanga.honeypot.net (kanga.honeypot.net [IPv6:2001:470:a80a:1:21f:d0ff:fe22:b8a8]) by mx1.freebsd.org (Postfix) with ESMTP id 463658FC17 for ; Sat, 16 May 2009 17:27:27 +0000 (UTC) (envelope-from kirk@strauser.com) Received: from localhost (localhost [127.0.0.1]) by kanga.honeypot.net (Postfix) with ESMTP id 379E53689D for ; Sat, 16 May 2009 12:27:26 -0500 (CDT) X-Virus-Scanned: amavisd-new at honeypot.net Received: from kanga.honeypot.net ([127.0.0.1]) by localhost (kanga.honeypot.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zun7zrbI4Y69 for ; Sat, 16 May 2009 12:27:24 -0500 (CDT) Received: from pooh.honeypot.net (pooh.honeypot.net [IPv6:2001:470:a80a:1:20a:95ff:fed5:10f2]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by kanga.honeypot.net (Postfix) with ESMTPSA id 091E73688B for ; Sat, 16 May 2009 12:27:23 -0500 (CDT) Message-Id: <43B3CD0F-BDCB-4DEC-9E17-E0D7A8287FDE@strauser.com> From: Kirk Strauser To: FreeBSD Questions ML Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sat, 16 May 2009 12:27:22 -0500 X-Mailer: Apple Mail (2.935.3) Subject: Limiting resources in cron jobs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2009 17:27:27 -0000 I have a jail where the www user runs hourly cron jobs. On rare occasion, these jobs get stuck in a seemingly infinite CPU loop - a Python script calls Ghostscript and that child process never returns - and I have to manually kill them. I'd like to use login.conf to set resource limits so that I don't have to do this myself, but they don't seem to be applied. Here's a snippet of my login.conf: www:\ :cputime=300:\ :tc=default: I've run "cap_mkdb /etc/login.conf" to make that live. Then, I used vipw to change www's class: www:*:80:80:www:0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin However, I can trigger the error condition and watch the child Ghostscript process run for 6-7 minutes before I kill it. It's my understand that cron uses the limits from login.conf. Any idea what I might be doing wrong and causing it not to do so? -- Kirk Strauser