3 Replies Latest reply on Nov 5, 2003 12:22 PM by john_anderson_ii

    Jboss startup under Slackware

    john_anderson_ii

      Does anyone reading this have a good rc type init script for JBoss that I could study.

      I authored one myself, and it works well for starting and stopping Jboss. However, when I try to restart jboss, the processes from the JVM are bound to my tty, or pts, as the case may be. In any event, this works ok until I logout and the JVM process get the old signal 9.

      This is what I've got:

      #!/bin/sh


      case "$1" in
      'start')
      /usr/local/java/jboss/bin/run.sh ;;
      'stop')
      /usr/local/java/jboss/bin/shutdown.sh -S ;;
      'restart')
      /usr/local/java/jboss/bin/shutdown.sh -S ;;
      sleep 2
      /usr/local/java/jboss/bin/run.sh ;;
      *)
      echo "usage $0 start|stop|restart" ;;

      When the machine starts and init 4 calls rc.4, rc.4 calls rc.jboss, the script above, dead last. Everything is just peachy unless I login, root the box, and run /etc/rc.d/rc.jboss restart.

      After that, I can never log out!

        • 1. Re: Jboss startup under Slackware
          jonlee

          The following works for Slackware 9.1. I usually have JBoss running automatically when I boot my laptop.

          You will need this in the run.sh script for JBoss to capture the PID.
          echo $$ > /tmp/jboss.pid

          The script is intended to run as root and then the script runs the JBoss process as the apache user. The less privileged account means that run.sh cannot write the PID to /var/run/jboss.pid directly, hence the messing around with the transfer in the rc.d script. The most important point is to send the run script into the background and reroute all console output to a designated log file.

          • 2. Re: Jboss startup under Slackware
            john_anderson_ii

            Awesome!

            Thanks man, I'll put this to good use right away.

            • 3. Re: Jboss startup under Slackware
              john_anderson_ii

              Update!

              Works like a champ! It still binds to my tty if I start or restart it manually, but that doesn't matter as it is not listed as a job attached my uid. Therefore it doesn't exit when I logout.

              Thanks again.