PDA

View Full Version : Process limit control



jazzfan
24th February 2008, 01:55 PM
hi! I'm doing the php program evulator. The maximum time for a process should be 1s, and memory limit 32MB (both stack and heap). I tried to to that by adding a new user "limit" and applying new rules for him in /etc/security/limits.config:


limit hard cpu 1
limit hard memlock 32768


I run some program which may run for mouths using following command:


su limit -c "date; cd; ./md5 10; date"


The code was running for aprox 18 minutes. Then I run this command:


su limit -c "ulimit -t 1"


I run program once more using the same command and this time it was killed for aprox 11s.
Please help, what am I doing wrong?

jazzfan
24th February 2008, 02:22 PM
it seems to me like it's adding +10 more time. I put 1 second limit, it's terminated in 11s. I add 1m limit, it's terminated in 11min.. etc etc. How can i fix that?