Re: Limiting resources in cron jobs

2009-05-22 Thread Dan
exec the script with softlimit from daemontools (very easy to use), or
exec with ulimit in the shell.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Limiting resources in cron jobs

2009-05-20 Thread Mel Flynn
On Saturday 16 May 2009 19:27:22 Kirk Strauser wrote:

 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.

Check with top what the CPU time is, it's not the same as the wall clock.
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Limiting resources in cron jobs

2009-05-20 Thread Kirk Strauser

On May 20, 2009, at 7:00 AM, Mel Flynn wrote:

Check with top what the CPU time is, it's not the same as the wall  
clock.



Give me *some* credit. :-)
--
Kirk Strauser




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Limiting resources in cron jobs

2009-05-20 Thread Mel Flynn
On Wednesday 20 May 2009 16:18:28 Kirk Strauser wrote:
 On May 20, 2009, at 7:00 AM, Mel Flynn wrote:
  Check with top what the CPU time is, it's not the same as the wall
  clock.

 Give me *some* credit. :-)

Sorry, haven't you heard? Financial crisis ;)
Are you sure cron respects login.conf? I don't see it mentioned in the man 
page. Have you tried modifying the offending crontab to run using limits(1) 
program?

AFAIK, cron doesn't use login(1) or underlying infrastructure, yet it uses 
pam.
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Limiting resources in cron jobs

2009-05-16 Thread Kirk Strauser
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




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org