Soeren Gerlach
2004-07-20 22:18:25 UTC
Hi,
I've a relatively fresh out-of-the-box Suse 9.0 box. I want to set up
a job via cron that starts an application with up to 1800 java
threads; java threads are mapped as processes so the application needs
to be allowed to run 1800 processes.
I changed /etc/security.limits.conf
* hard nofile 8192
* hard nproc 8192
THIS should really be enough ,-) And I added the following line to
/etc/pam.d/login as well as /etc/pam.d/sshd (the later one for
testing, see below)
session required pam_limits.so debug
My problem is now that a simple cronjob, where I can test this, does
not work as supposed:
( ulimit -a ; echo ; ulimit -n 4096 ; echo ; ulimit -a ) 2>&1 | mail
foobar
results in an error message "/bin/sh: line 1: ulimit: open files:
cannot modify limit: Operation not permitted".
Funny enough: If I login via ssh it's not a problem, works like a
charm. Also while using sshd I can see from the log file, that the
limits module really is pulling the settings out of the limits.conf
file so I suppose the mechanism itself work.
Naive like I am I tried to add the above line to a newly create file
/etc/pam.d/cron (and "crond" as well) but this did not helped
anything.
So...what the bl**dy hell am I doing wrong?
Thanks a lot,
Soeren Gerlach
I've a relatively fresh out-of-the-box Suse 9.0 box. I want to set up
a job via cron that starts an application with up to 1800 java
threads; java threads are mapped as processes so the application needs
to be allowed to run 1800 processes.
I changed /etc/security.limits.conf
* hard nofile 8192
* hard nproc 8192
THIS should really be enough ,-) And I added the following line to
/etc/pam.d/login as well as /etc/pam.d/sshd (the later one for
testing, see below)
session required pam_limits.so debug
My problem is now that a simple cronjob, where I can test this, does
not work as supposed:
( ulimit -a ; echo ; ulimit -n 4096 ; echo ; ulimit -a ) 2>&1 | mail
foobar
results in an error message "/bin/sh: line 1: ulimit: open files:
cannot modify limit: Operation not permitted".
Funny enough: If I login via ssh it's not a problem, works like a
charm. Also while using sshd I can see from the log file, that the
limits module really is pulling the settings out of the limits.conf
file so I suppose the mechanism itself work.
Naive like I am I tried to add the above line to a newly create file
/etc/pam.d/cron (and "crond" as well) but this did not helped
anything.
So...what the bl**dy hell am I doing wrong?
Thanks a lot,
Soeren Gerlach