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 file limits.conf;when a weekly job is executed which I have set up from cron, I have the correct value from limits.conf (16,384);when I do /bin/su - user and then restart, I have the correct valuealso.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 -Haopen files                      (-n) 4096Global:cat /etc/security/limits.conforacle hard nofile 16384Problem: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.
how to run script with a clean login shell
bash;shell;ulimit