5 Replies Latest reply on Jan 27, 2010 11:13 AM by Peter Johnson

    JBOSS does not start up on boot

    Pratik Mathur Newbie

      Hello all,

       

      I'm trying to get JBoss to start up on boot.  I am running Debian 2.1

       

      I'm using this website: http://www.debian-administration.org/article/Making_scripts_run_at_boot_time_with_Debian

       

      This is the script I'm using:

       

      #! /bin/sh
      #  /etc/init.d/jboss: Start and stop JBoss AS
      ECHO=/bin/echo
      TEST=/usr/bin/test
      JBOSS_START_SCRIPT=/usr/local/jboss-4.0.3SP1/bin/run.sh
      JBOSS_STOP_SCRIPT=/usr/local/jboss-4.0.3SP1/bin/shutdown.sh

      $TEST –x $JBOSS_START_SCRIPT || exit 0
      $TEST –x $JBOSS_STOP_SCRIPT || exit 0

      start() {
            $ECHO –n "Starting JBoss"
            su – jboss –c "$JBOSS_START_SCRIPT > /dev/null 2> /dev/null &"
            $ECHO "."
      }

      stop() {
            $ECHO –n "Stopping JBoss"
            su – jboss – c "$JBOSS_STOP_SCRIPT –S > /dev/null &"
            $ECHO "."
      }

      case "$1" in
            start)
                  start
                  ;;
            stop)
                  stop
                  ;;
            restart)
                  stop
                  sleep 30
                  start
                  ;;
            *)
                  $ECHO "Usage: jboss {start|stop|restart}"
                  exit 1
      esac

      exit 0

       

      However, when I follow the instructions on the website and do:

       

      ./jboss

       

      I get an error : /usr/bin/test: extra argument `/opt/jboss-4.2.3.GA/bin/run.sh

       

      I get the same thing for the shutdown.sh part.

       

      When I add arguments to both of those lines, it still complains.  Any ideas what I may be doing wrong?

       

      I know I'm really close, probably just a minor tweak.

       

      All / any input from you all will definitely help! I will give points to right answers.