[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Questions about /etc/profile ulimit -Hn and /etc/initscript & /etc/security/limits

When running java w/ another program I get this error message-
java.io.IOException: Too many open files
I was told
1) change /etc/profile to add ulimit -Hn 65536
2)create /etc/initscript as described in man initscript, including ulimit -Hn 65536
Someone else mentioned /etc/security/limits.
Now I have looked at /etc/profile which is gibberish for someone like me who knows nothing about shell scripts. I wonder do I just add the line "ulimit -Hn 65536" anywhere in that file?? Next question- I have read man initscript and wonder do I take that sample file- change the ulimit -Hn to 65536 and save. This particular line- "Experimenting with this can make your system un(re)bootable." has be quite worried. In /etc/security/limits everything is commented out without any reference to ulimits. Yes I have googled without luck- specifically Debian way of doing this. Here is /etc/profile-
"# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$PS1" ]; then
 if [ "$BASH" ]; then
   PS1='\u@\h:\w\$ '
   if [ "`id -u`" -eq 0 ]; then
     PS1='# '
     PS1='$ '
ulimit -Hn 65536
export PATH
#export CLASSPATH=.:/usr/local/j2re1.4.2_04/lib:/usr/local/j2re1.4.2_04/lib
#export JAVA_HOME=/usr/local/j2re1.4.2_04
#export PATH=$PATH:/usr/local/j2re1.4.2_04/bin
umask 022"
You can see I added "ulimit -Hn 65536". I havent rebooted yet out of fear *grimace*
Considering the path to java is below
and the path to the other program is /home/user/program/program.sh
Do I need to be specific about java or user in /etc/profile?
Lastly do I need to set something in /etc/security/limits?

After banging my head on this problem I have a headache and need aspirin. I hope someone will help me out with this ulimit problem.

Reply to: