8 Replies Latest reply on May 31, 2014 4:52 AM by wdfink

    JBoss start up script standalone.sh

    praneshinjboss

      I have a custom startup script for starting JBoss (JBoss EAP 6.2.0.GA) instance.

      When I call start.sh [./standalone.sh &], it is starting in background jboss process. But when i do the same as

      ./standalone.sh -b 192.x.x.x -Djboss.server.base.dir=/opt/jboss-6.2.0/all &, it also starts in background but I also see start.sh running but not exiting. Can someone point me what is the issue?

       

      start.sh

      #!/bin/bash

      cd /opt/jboss-6.2.0/bin

      #./standalone.sh -b 10.1.12.80 -Djboss.server.base.dir=/opt/jboss-6.2.0/all &

      ./standalone.sh &   

        • 1. Re: JBoss start up script standalone.sh
          wdfink

          It's more a Unix question,

          but if you add a "&"  with a space after the command the process will run in background.

          You can see that the process running standalone.sh has the parent 1

           

          BTW you should use 2>&1 >file or /dev/null as otherwise the console will show the complete output

          • 2. Re: JBoss start up script standalone.sh
            praneshinjboss

            Thanks for the response.

             

            When i started using below command, I'm seeing 2 process running, one for jboss & another for standalone.sh

            ./standalone.sh -b 192.x.x.x -Djboss.server.base.dir=${JBOSS_HOME}/all  2>&1 >>  all/server.log &

             

            ppandian  5041     1  0 09:59 pts/2    00:00:00 /bin/sh ./standalone.sh -b 192.x.x.x -Djboss.server.base.dir=/opt/jboss-6.2.0/all

             

            ppandian  5114  5041 99 09:59 pts/2    00:00:04 /opt/jdk1.7.0_55/bin/java -D[Standalone] -server -XX:+UseCompressedOops -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/jboss-6.2.0/all/log/server.log -Dlogging.configuration=file:/opt/jboss-6.2.0/all/configuration/logging.properties -jar /opt/jboss-6.2.0/jboss-modules.jar -mp /opt/jboss-6.2.0/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/opt/jboss-6.2.0 -Djboss.server.base.dir=/opt/jboss-6.2.0/all -b 192.x.x.x -Djboss.server.base.dir=/opt/jboss-6.2.0/all

             

            When i use the below command, I see only process running is for JBoss not standalone.sh process.

            ./standalone.sh &

             

            ppandian  5481  5422 99 10:04 pts/3    00:00:05 /opt/jdk1.7.0_55/bin/java -D[Standalone] -server -XX:+UseCompressedOops -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djav .net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/jboss-6.2.0/standalone/log/server.log -Dlogging.configuration=file:/opt/jboss-6.2.0/standalone/configuration/logging.properties -jar /opt/jboss-6.2.0/jboss-modules.jar -mp /opt/jboss-6.2.0/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/opt/jboss-6.2.0 -Djboss.server.base.dir=/opt/jboss-6.2.0/standalone

             

            Previous version of jboss 3/4/5, when i have some simple custom script to start jboss, I see only jboss process running, not run.sh/standalone.sh.

             

            Is the new way implemented in JBoss 7?

            Also in standalone.sh under bin dir of JBoss Home, I do see variable defined as LAUNCH_JBOSS_IN_BACKGROUND to run in background but not seeing the value for that variable is declared elsewhere.

            So I exported a variable LAUNCH_JBOSS_IN_BACKGROUND=1 or LAUNCH_JBOSS_IN_BACKGROUND=true to make it run in background, not still its running in foreground.

             

            Can you please advice me if Im missing something?

             

            Thanks in advance.

            • 3. Re: JBoss start up script standalone.sh
              wdfink

              If I look to your ps output the java process parent is not "1" for init. So there should be a shell handling it.

              The LAUNCH variable only have a different handling for i.e. Signals, the process should be started in the same way.

               

              IIRC earlier JBoss versions work similar

              • 4. Re: JBoss start up script standalone.sh
                praneshinjboss

                You are right. I have highlighted the process id. standalone.sh parent id is 1. But the actual jboss process parent id is 5041 which is standalone.sh id. So not sure if this is the right away of starting the server. Confusing part is standalone.sh & does not show 2 process running.

                 

                ppandian  5041     1  0 09:59 pts/2    00:00:00 /bin/sh ./standalone.sh -b 192.x.x.x -Djboss.server.base.dir=/opt/jboss-6.2.0/all

                 

                ppandian  5114  5041 99 09:59 pts/2    00:00:04 /opt/jdk1.7.0_55/bin/java -D[Standalone] -server -XX:+UseCompressedOops -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/jboss-6.2.0/all/log/server.log -Dlogging.configuration=file:/opt/jboss-6.2.0/all/configuration/logging.properties -jar /opt/jboss-6.2.0/jboss-modules.jar -mp /opt/jboss-6.2.0/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/opt/jboss-6.2.0 -Djboss.server.base.dir=/opt/jboss-6.2.0/all -b 192.x.x.x -Djboss.server.base.dir=/opt/jboss-6.2.0/all

                • 5. Re: JBoss start up script standalone.sh
                  wdfink

                  In my environment it does not matter whether standalone.sh is started w/o parameter. Both cases show two processes, the .sh and the java process. SH's parent is 1 if you run in background.

                  That is the way the server is started.

                  • 6. Re: JBoss start up script standalone.sh
                    praneshinjboss

                    Thank you. That clears my understanding.

                    • 7. Re: JBoss start up script standalone.sh
                      praneshinjboss

                      Just FYI.

                       

                      I have installed centos in oracle VM and I'm using jboss EAP 6.2.0 and started the server. I see only jboss instance running but not standalone.sh.

                      Whereas in ubuntu, the same jboss version while running has 2 process as stated before. Not sure if there is anything different between OS.

                      • 8. Re: JBoss start up script standalone.sh
                        wdfink

                        Seems to me that it is not a difference for the processes, as both are linux systems and the shell should not so different.