Thursday, October 22, 2009

JBoss and file handles on RedHat

I discovered that my jboss 4.0.5-GA instance was running out of file handles on subsequent war deployments, so I had to set find a way to make the server more robust. I did a little googling around on ulimit. At the time, I was running JBoss as root and finally decided to break down and create a jboss account. I then config /etc/security/limits.conf; borrowing from an article on setting up oracle for more file handles. I added: 
jboss soft nofile 4096
jboss hard nofile 63536 
I created a jboss account without a password and added jboss/bin/init.id/jboss as a sym link to boss's $JBOSS_HOME/bin/jboss_init_redhat.sh. I modified the start script to put the log file to /var/log/jboss.log and opted to set the default server for my server. You do have to add a couple of lines for chkconfig to work right: 
#!/bin/sh
#
# jboss Startup script for the JBoss J2EE App Server
#
# chkconfig: - 85 15
# description: JBoss is a J2EE app server
#
# processname: jboss 
Then you can add to the init tab with:

chkconfig --add jboss
chkconfig --level 5 jboss on

No comments: