5 Replies Latest reply on Dec 15, 2011 2:33 AM by wdfink

    install jBoss 5.0.1.GA on ubuntu 11.04 desktop

    halfdomedog

      Hello,

      I am trying to install jBoss as on my ubuntu desktop. I have followed the instructions from http://www.surajitray.com/coders-corner/jboss-5-1-on-ubuntu-10-04/ with the exception of having another directory called jboss-5.1.0.GA that lies under /usr/local/jboss. I am recieving the following error when trying to execute "sudo /etc/init.d/jboss start": "/etc/init.d/jboss: 31: Bad substitution". Being a new user to jBoss, I am a little lost at this point. Any and all help will be greatly appreiciated.

       

      Thank you in advance,

      halfdomedog

        • 1. Re: install jBoss 5.0.1.GA on ubuntu 11.04 desktop
          wdfink

          Looks like that the script for ubuntu that you have build is wrong or you edit wrong.

          See line 31 of that script.

          Maybe you add 'set -x' to the script and post the output.

          • 2. Re: install jBoss 5.0.1.GA on ubuntu 11.04 desktop
            halfdomedog

            Wolf-Dieter,

            Thank you for the reply. I have checked line 31 of my script and found JBOSS_BIND_ADDR=${JBOSS_HOST:"-b 0.0.0.0"}. I am not quite sure where to add 'set-x' to my scipt so I just added the contents of my script below. Hopefully it helps.

            ==================================================================================================

            #!/bin/sh

            #

            # $Id: jboss_init_redhat.sh 81068 2008-11-14 15:14:35Z dimitris@jboss.org $

            #

            # JBoss Control Script

            #

            # To use this script run it as root - it will switch to the specified user

            #

            # Here is a little (and extremely primitive) startup/shutdown script

            # for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,

            # it's run by user 'jboss' and JDK binaries are in /usr/local/jdk/bin.

            # All this can be changed in the script itself.

            #

            # Either modify this script for your requirements or just ensure that

            # the following variables are set correctly before calling the script.

             

             

            #define where jboss is - this is the directory containing directories log, bin, conf etc

            JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss/jboss-5.1.0.GA"}

             

            #define the user under which jboss will run, or use 'RUNASIS' to run as the current user

            JBOSS_USER=${JBOSS_USER:-"jboss"}

             

            #make sure java is in your path

            JAVAPTH=${JAVAPTH:-"/usr/bin"}

             

            #configuration to use, usually one of 'minimal', 'default', 'all'

            JBOSS_CONF=${JBOSS_CONF:-"default"}

             

            #if JBOSS_HOST specified, use -b to bind jboss services to that address

            #JBOSS_BIND_ADDR=${JBOSS_HOST:+"-b $JBOSS_HOST"}

            JBOSS_BIND_ADDR=${JBOSS_HOST:”-b 0.0.0.0″}

             

            #define the classpath for the shutdown class

            JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"}

             

            #define the script to use to start jboss

            JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF $JBOSS_BIND_ADDR"}

             

            if [ "$JBOSS_USER" = "RUNASIS" ]; then

              SUBIT=""

            else

              SUBIT="su - $JBOSS_USER -c "

            fi

             

            if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then

              # ensure the file exists

              touch $JBOSS_CONSOLE

              if [ ! -z "$SUBIT" ]; then

                chown $JBOSS_USER $JBOSS_CONSOLE

              fi

            fi

             

            if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then

              echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"

              echo "WARNING: ignoring it and using /dev/null"

              JBOSS_CONSOLE="/dev/null"

            fi

             

            #define what will be done with the console log

            JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}

             

            JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"

            JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}

             

            if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then

              export PATH=$PATH:$JAVAPTH

            fi

             

            if [ ! -d "$JBOSS_HOME" ]; then

              echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME

              exit 1

            fi

             

            echo JBOSS_CMD_START = $JBOSS_CMD_START

             

            case "$1" in

            start)

                cd $JBOSS_HOME/bin

                if [ -z "$SUBIT" ]; then

                    eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &

                else

                    $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &"

                fi

                ;;

            stop)

                if [ -z "$SUBIT" ]; then

                    $JBOSS_CMD_STOP

                else

                    $SUBIT "$JBOSS_CMD_STOP"

                fi

                ;;

            restart)

                $0 stop

                $0 start

                ;;

            *)

                echo "usage: $0 (start|stop|restart|help)"

            esac

            =========================================================================================================

            • 3. Re: install jBoss 5.0.1.GA on ubuntu 11.04 desktop
              wdfink

              If there is no fault by copy'n'paste it looks like that the " quote after -b 0.0.0.0 is not correct.

              Check whether it is the same as the first and also the same as the other ones.

              1 of 1 people found this helpful
              • 4. Re: install jBoss 5.0.1.GA on ubuntu 11.04 desktop
                halfdomedog

                I made sure that the quote after -b 0.0.0.0 is the same as the first and that the quotes are the same as the others in the file. But I am still recieving the error. I actually commented line 31 out and I am still recieving the error. If you have any other suggestions, that would be great.

                • 5. Re: install jBoss 5.0.1.GA on ubuntu 11.04 desktop
                  wdfink

                  First, if you try to add files, please attach it instead of posting. User edit after you post your text. It makes our job easier.

                   

                  I apply the changes to a new jboss-init_redhat.sh and attach it, hope that help. You might diff it to yours (I hoe I have the same 5.1.0 version as you)