I am connected to remote machine Linux RH6 directly via ssh (key imported on server), when I execute a shell script with arguments for restarting the java service, I have a strange issue with ulimit:
- when I manually run
./script.sh stop;./catalina.sh start
I see that the number of open files is not OK (1024) as defined in system filelimits.conf
; - when a weekly job is executed which I have set up from
cron
, I have the correct value fromlimits.conf
(16,384); - when I do
/bin/su - user
and then restart, I have the correct value
also.
I need a solution to modify the script to somehow source my system value and have real login shell in the bash script and to have the correct number of open files when I need to restart the service manually.
Hard limit for current shell:
ulimit -Ha
open files (-n) 4096
Global:
cat /etc/security/limits.conf
oracle hard nofile 16384
Problem:
when cron job is executed number of opened files is 16384 good!, when i run script from current shell ./script.sh stop; ./script.sh start
i have 4096. Question is
how to get 16384 when i run script manually ?
Ps editing of bashrc
and bash_profile
with ulimit -n <number>
does not help.
/bin/su -c - user /path/to/script.sh
, or addulimit -n 16384
to your script.script.sh
? What iscatalina.sh
? Where do you see the open files? What is the crontab your are using? How is Matt's solution "not clean"? What would a "clean" solution require? Please edit your question and clarifyulimit -n 16384
to your.bash_profile
or.bashrc
to try and resolve the issue with your environment.