4 Replies Latest reply on May 20, 2010 10:44 AM by Lukas Basnak

    JBoss run.conf and initial script

    Lukas Basnak Newbie

      Hello all,


      I have problem with starting JBoss server with jboss_init_redhat.sh. I think that I have correct configuration in init script. So problem is, that when I start jboss 4.2.2 GA with jboss_init_redhat.sh script, it ignore my settings in run.conf. I need to change JAVA_OPTS via run.conf.


      If I start jboss from command line like .../bin/run.sh -b my.host....  it starts correct and accept run.conf JAVA_OPTS.


      My run.conf looks:

      if [ "x$JAVA_OPTS" = "x" ]; then
         JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=192m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"


      In jboss_init_redhat.sh is commands like:







      And finally default look of run.sh in part of configuration file:

      # Read an optional running configuration file
      if [ "x$RUN_CONF" = "x" ]; then
      if [ -r "$RUN_CONF" ]; then
          . "$RUN_CONF"



      When I start it from jboss_init_redhat.sh (it ignores run.conf -> Xms1024m,Xmx1024m and MaxPermSize) :

      508       9479  9458 17 18:27 ?        00:00:38 /opt/java/bin/java -Dprogram.name=run.sh -server -Xms512m -Xmx512m -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/jboss/lib/endorsed -classpath /opt/jboss/bin/run.jar:/opt/java/lib/tools.jar org.jboss.Main -c default -b


      When I start it from jboss like    run.sh -b my.host, it reads run.conf and apply it:



        JBoss Bootstrap Environment


        JBOSS_HOME: /opt/jboss


        JAVA: /opt/java/bin/java


        JAVA_OPTS: -Dprogram.name=run.sh -server -Xms1024m -Xmx1024m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true


        CLASSPATH: /opt/jboss/bin/run.jar:/opt/java/lib/tools.jar



      root      9852  9830 99 18:53 pts/2    00:00:08 /opt/java/bin/java -Dprogram.name=run.sh -server -Xms1024m -Xmx1024m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/jboss/lib/endorsed -classpath /opt/jboss/bin/run.jar:/opt/java/lib/tools.jar org.jboss.Main -b



      So do you have any idea, how to force jboss to use run.conf?


      Thank you very much,



        • 1. Re: JBoss run.conf and initial script
          jaikiran pai Master

          Do you by any chance have a run.conf in JBOSS_HOME/server/< servername>/ folder? And please post the exact output that you see on the console (including the echo statements) when you start the server using the jboss_init_redhat.sh script.

          1 of 1 people found this helpful
          • 2. Re: JBoss run.conf and initial script
            Daniel Cullender Newbie

            try enable script debugging (set -x) 

            1 of 1 people found this helpful
            • 3. Re: JBoss run.conf and initial script
              Lukas Basnak Newbie

              Hello guys,

              I don't know why (I didn't read all documentation for jboss), for this time, it helps me, when a start jboss with jboss user, and jdk folder owns jboss too.

              When my problem starts, the jdk folder owns root

              After change permissions to jboss on jdk folder, it start works, and run.conf was accepted



              Sorry Lines above are not exactly truth. I tested it again and when i start scrip as root and in script JBOSS_USER=root, than it works (run.conf is accepted), but then when I start it as  JBOSS_USER=jboss, run.conf is ignored.... 


              Thank you,



              • 4. Re: JBoss run.conf and initial script
                Lukas Basnak Newbie

                OK, for this time, problem solved.


                This helps me in run.conf

                unset JAVA_OPTS
                if [ "x$JAVA_OPTS" = "x" ]; then
                   JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:PermSize=192m -XX:MaxPermSize=192m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"


                Why?  I don't know, but after start and stop jboss server, the user, whos jboss going on behalf JBOSS_USER=${JBOSS_USER:-"jboss"}, has after stop jboss in environment this settings:


                pc$ echo $JAVA_OPTS

                -Xms512m -Xmx512m


                so in next start of Jboss, the condition in run.conf

                if [ "x$JAVA_OPTS" = "x" ]; then ....      was false  "x-Xms512m -Xmx512m" = "x"  , so if it was false, my JAVA_OPTS was not loaded...


                so clean the JAVA_OPTS variable before condition helps to me


                Thanks all,