1 Reply Latest reply on Aug 19, 2008 6:59 AM by wslyhbb

    JBoss AS 4.2.3 start as service question

    wslyhbb

      I previously had JBoss 4.0.5, I have upgraded to JBoss 4.2.3. I start JBoss at boot as a service.

      /etc/rc.d/init.d/jboss:
      #! /bin/sh

      JBOSS_LOG_FILE=/var/log/jboss
      JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss-4.2.3.GA"}

      start(){
      echo "Starting jboss.."

      # If using an SELinux system such as RHEL 4, use the command below
      # instead of the "su":
      # eval "runuser - jboss -c '/opt/jboss/current/bin/run.sh > /dev/null 2> /dev/null &'
      # if the 'su -l ...' command fails (the -l flag is not recognized by my su cmd) try:
      # sudo -u jboss /opt/jboss/bin/run.sh > /dev/null 2> /dev/null &
      su -l jboss -c '$JBOSS_HOME/bin/run.sh 2>&1 $JBOSS_LOG_FILE &'
      }

      stop(){
      echo "Stopping jboss.."

      # If using an SELinux system such as RHEL 4, use the command below
      # instead of the "su":
      # eval "runuser - jboss -c '/opt/jboss/current/bin/shutdown.sh -S &'
      # if the 'su -l ...' command fails try:
      # sudo -u jboss /opt/jboss/bin/shutdown.sh -S &
      su -l jboss -c '$JBOSS_HOME/bin/shutdown.sh -S &'
      }

      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)
      su -l jboss -c 'killall java'
      # if the 'su -l ...' command fails try:
      # sudo -u jboss killall java
      start
      }



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

      exit 0

      But when you do # service jboss start
      Starting jboss..
      Creating directory '/usr/local/jboss-4.0.5.GA/'.
      Creating directory '/usr/local/jboss-4.0.5.GA//tmp'.

      Where is it getting the jboss-4.0.5? I do not get it. The service starts fine, but I want to know why it is creating those folders.

      Thanks.