0 Replies Latest reply on Apr 29, 2005 6:07 PM by Jay Konkin

    JBOSS Auto Start in Solaris 10

    Jay Konkin Newbie

      I am running JBOSS 3.2.1-Tomcat-4.1.24 on Solaris 10 x86.
      When I start JBOSS using the script below from command line everything runs fine.
      The problem is It will not start when I reboot solaris.
      Softlinks are setup as follows

      ln /etc/sfw/jboss /etc/rc3.d/S99jboss
      ln /etc/sfw/jboss /etc/rc0.d/K00jboss
      ln /etc/sfw/jboss /etc/rc1.d/K00jboss
      ln /etc/sfw/jboss /etc/rc2.d/K00jboss
      ln /etc/sfw/jboss /etc/rcS.d/K00jboss

      jboss script follows
      #
      #

      #define where jboss is - this is the directory containing directories log, bin, conf etc
      #JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"}
      JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss-3.2.1_tomcat-4.1.24"}

      #make java is on your path
      #JAVAPTH=${JAVAPTH:-"/usr/local/jdk/bin"}
      JAVAPTH=${JAVAPTH:-"/usr/j2se/bin"}

      #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"}

      if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
      # ensure the file exists
      touch $JBOSS_CONSOLE
      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"}

      #define the user under which jboss will run, or use RUNASIS to run as the current user
      JBOSSUS=${JBOSSUS:-"RUNASIS"}

      CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
      CMD_STOP="java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"

      if [ "$JBOSSUS" = "RUNASIS" ]; then
      SUBIT=""
      else
      SUBIT="su - $JBOSSUS -c "
      fi

      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 CMD_START = $CMD_START


      case "$1" in
      start)
      cd $JBOSS_HOME/bin
      if [ -z "$SUBIT" ]; then
      eval $CMD_START >${JBOSS_CONSOLE} 2>&1 &
      else
      $SUBIT "$CMD_START >${JBOSS_CONSOLE} 2>&1 &"
      fi
      ;;
      stop)
      if [ -z "$SUBIT" ]; then
      $CMD_STOP
      else
      $SUBIT "$CMD_STOP"
      fi
      ;;
      restart)
      $0 stop
      $0 start
      ;;
      *)
      echo "usage: $0 (start|stop|restart|help)"
      esac