3 Replies Latest reply on Mar 4, 2010 6:20 AM by Rasa Here

    Jboss as a service

    Rasa Here Novice

      Hi,

       

      I am using jboss 4.2.3 GA. I am starting jboss using

       

      nohup ./run.sh -Djboss.bind.address=221.1.1.172 &

      If i want to give it on service how i will give that.

       

      su -l  -c 'nohup /usr1/second-jboss/jboss-4.2.3.GA/bin/run.sh -Djboss.bind.address=221.1.1.172 &' - jboss

       

      I tried  this command through the console and nothing happens or i am not understanding what is happening . So i guess it is wrong. Anyway i am playing with it. Please help with your suggestions and guidance.

       

      Thanks And Regards

      Rasa.

        • 1. Re: Jboss as a service
          Rohit Macherla Novice

          Hi Rasa,

           

          Though I have not tried making JBoss startup as a service. I know that there are a few scripts that can take care of this functionality.

          You may use the scripts:

          jboss_init_redhat.sh

          jboss_init_hpux.sh

          jboss_init_suse.sh

           

          for making JBoss start as a service. These scripts are present in the JBOSS_HOME/bin/

           

          Hope it helps.

          1 of 1 people found this helpful
          • 2. Re: Jboss as a service
            Rasa Here Novice

            Hi Rohit,

             

            I am starting jboss by using following commnad

            nohup ./run.sh -Djboss.bind.address=211.1.1.172 &

             

            and from bin dir when i execute

            sh jboss_init_redhat.sh stop

             

            It is giving following messages

            JBOSS_CMD_START = cd /usr1/jboss/jboss-4.2.3.GA/bin; /usr1/jboss/jboss-4.2.3.GA/bin/run.sh -c default

            No JBossas is currently running

            I thik it is not getting the bind address. Either that have to be hardcoded in the script or i have to pass it as an argument. Let me try all this.

             

            Thanks for your guidance.

            • 3. Re: Jboss as a service
              Rasa Here Novice

              Yes the issue is solved.

               

              1) Make a file with the name jboss, if more than one instance is there then make  jboss1, jboss2 etc and copy the belwo content in to that file. Change the file path, jnp port , binding address etc

               

              start(){
                      echo "Starting jboss.."
                     
              su -l -c 'nohup /usr1/jboss/jboss-4.2.3.GA/bin/run.sh -Djboss.bind.address=211.1.1.172 &' - jboss

              }

              stop(){
                      echo "Stopping jboss ...."
              su -l -c 'nohup /usr1/jboss/jboss-4.2.3.GA/bin/shutdown.sh --server 211.1.1.172:1099 &' - jboss
              }

              restart(){
                      stop
              # give stuff some time to stop before we restart
                     sleep 60
              # protect against any services that can't stop before we restart (warning this kills all Java instances running as 'jboss' user)
              # if the 'su -l ...' command fails try:
                      start
              }

               

               

              Thanks and Regards

              Rasa