Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 38

Thread: Install jboss as daemon (autostart at boot)

  1. #11
    Join Date
    Aug 2008
    Beans
    1

    Re: Install jboss as daemon (autostart at boot)

    Thanks for this guide. It's for me is the only way to start JBoss as daemon on Ubuntu.
    I tried to use JS Wrapper as alternative way, but unfortunately my attempts was unsuccessful due to "wrapper: cannot execute binary file" error. May be somebody has experience with mentioned tool?

  2. #12
    Join Date
    Aug 2008
    Beans
    1

    Re: Install jboss as daemon (autostart at boot)

    Quote Originally Posted by AdagioParaCuerdas View Post
    i got an error with the sh script

    # sudo /etc/init.d/jboss start
    JBOSS_CMD_START = cd /home/jboss/jboss/bin; /home/jboss/jboss/bin/run.sh -c default
    /etc/init.d/jboss: 71: Syntax error: "(" unexpected

    it refers to:
    I came unstuck with this problem in the redhat script, something to do with the 'function' keyword? - Not enough shell skills!

    I found an alternative script on the forum at:
    http://ubuntuforums.org/archive/index.php/t-492697.html

    which seems to work...

    Thanks for the post and replies by the way..

  3. #13
    Join Date
    Sep 2008
    Beans
    1

    Re: Install jboss as daemon (autostart at boot)

    Quote Originally Posted by AdagioParaCuerdas View Post
    i got an error with the sh script

    # sudo /etc/init.d/jboss start
    JBOSS_CMD_START = cd /home/jboss/jboss/bin; /home/jboss/jboss/bin/run.sh -c default
    /etc/init.d/jboss: 71: Syntax error: "(" unexpected

    it refers to:
    According to "Portable Shell Programming" by Bruce Blinn, a function is not delcared with a "function" keyword. A function is declared with only the function name. Delete the mistaken keyword from the script and it will execute.

  4. #14
    Join Date
    Sep 2008
    Beans
    2

    Re: Install jboss as daemon (autostart at boot)

    Great information!
    If I'd have knew that I wouldn't have spent the time to dig it for myself. However, if somebody is interested in my experience, I have installed JBoss 4.2.3.GA on my Ubuntu (8.04) machine and when trying to run it as a service I had some problems with the already-available scripts (e.g. for RedHat, SuSE, HPUX). Therefore I have derived the RedHat script and here are the steps that made my installation work:

    1. Create in /etc/init.d folder a file for the JBoss service (e.g. jboss.sh). Note that you need the right to create files there...
    2. Using your preferred editor (e.g. gedit), fill in the file with the following content (note that changes for your local installation are needed):
    Code:
          #!/bin/sh
          #
          # This script has been derived from the following one:
          # $Id: jboss_init_redhat.sh 71252 2008-03-25 17:52:00Z dbhole $
          #
          # 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 Ubuntu systems. It assumes that JBoss lives in /usr/local/jboss,
          # it's run by user 'jboss' and JDK binaries are in /usr/local/jdk.
          # 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.
          #
          # Major changes from the original one:
          # * usage of the shutdown.sh script instead of killing the jboss' JVM process. This simplifies the structure of the script.
          # * added support for bind address change (see the JBOSS_HOST variable).
    
          #define the JAVA_HOME
          JAVA_HOME=${JAVA_HOME:-"/usr/local/jdk"}
    
          #define where jboss is - this is the directory containing directories log, bin, conf etc
          JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"}
    
          #define the user under which jboss will run, or use 'RUNASIS' to run as the current user
          JBOSS_USER=${JBOSS_USER:-"jboss"}
    
          #configuration to use, usually one of 'minimal', 'default', 'all'
          JBOSS_CONF=${JBOSS_CONF:-"default"}
    
          #bind address
          JBOSS_HOST=${JBOSS_HOST:-"127.0.0.1"}
    
          #define the script used to start jboss
          JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF -b $JBOSS_HOST"}
    
          #define the script used to stop jboss
          JBOSSST=${JBOSSST:-"$JBOSS_HOME/bin/shutdown.sh -S -s jnp://$JBOSS_HOST:1099"}
    
          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="cd $JBOSS_HOME/bin; $JBOSSST"
    
          if [ ! -d "$JBOSS_HOME" ]; then
          echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
          exit 1
          fi
    
          case "$1" in
          start)
            cd $JBOSS_HOME/bin
            echo JBOSS_CMD_START = $JBOSS_CMD_START
            if [ -z "$SUBIT" ]; then
                eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
            else
                $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &" 
            fi
            ;;
          stop)
            cd $JBOSS_HOME/bin
            echo JBOSS_CMD_STOP = $JBOSS_CMD_STOP
            if [ -z "$SUBIT" ]; then
                eval $JBOSS_CMD_STOP >${JBOSS_CONSOLE} 2>&1 &
            else
                $SUBIT "$JBOSS_CMD_STOP >${JBOSS_CONSOLE} 2>&1 &" 
            fi
            ;;
          restart)
            $0 stop
            # there must be a time between the "stop" and the "start" because the mentioned two are asynchronous operations.
            # this depends on how fast your machine is.
            sleep 3
            $0 start
            ;;
          *)
            echo "usage: $0 (start|stop|restart)"
          esac
    3. Configure the script to start for your preferred runlevels (e.g. 3 and 5). To do this you can use the sysvconfig utility.

    The same information is available at http://cristivulpe.blogspot.com/2008...v-service.html.

    Regards,
    cristi

  5. #15
    Join Date
    Nov 2008
    Beans
    1

    Thumbs down Re: Install jboss as daemon (autostart at boot)

    Thank you very much!! It seems works for me!!

    Just in case, thank you very much ^^!!!

  6. #16
    Join Date
    Nov 2008
    Beans
    1

    Re: Install jboss as daemon (autostart at boot)

    Hello All,

    I am trying to RUN JBOSS As Daemon on Ubuntu Command Line Server.
    I have jboss-4.2.1.GA Server.
    After doing all the necessary set for running jboss as Daemon. I am getting an error saying "Command Not Found". "sudo /etc/init.d/jboss start"

    & when i tried this command "sudo /etc/init.d/jboss.sh start" it says "sudo: unable to execute /etc/init.d/jboss.sh: No such file or directory"

    Please help me out with this.

    -Chetan.

  7. #17
    Join Date
    Feb 2009
    Beans
    2

    Re: Install jboss as daemon (autostart at boot)

    CuBone,

    Thanks for all the effort of sharing this info. This guide is awesome and still works perfectly on server edition 8.10. The only problem I had was with this line in your init script:
    Code:
    JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}
    This needed to be changed to
    Code:
    JBOSS_HOST=${JBOSS_HOST:-"-b 0.0.0.0"}
    In order to work for me.

    Thanks again for the outstanding job!

  8. #18
    Join Date
    May 2008
    Location
    Denmark
    Beans
    89
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Install jboss as daemon (autostart at boot)

    Thanks for the guide. I'm just posting to clear up some of the confusing there seems to be with the JBOSS_HOST. If you've copied the init script for the downloaded jboss 4.2.2 codes, then you'll end up with a script that does not define JBOSS_HOST, however, it does define JBOSS_BIND_ADDR. The corect way to make this work like it should is to add JBOSS_HOST before the JBOSS_BIND_ADDR:

    Code:
    #define JBOSS_HOST so that it listens to all availible ips
    JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}
    
    #if JBOSS_HOST specified, use -b to bind jboss services to that address
    JBOSS_BIND_ADDR=${JBOSS_BIND_ADDR:-"-b $JBOSS_HOST"}
    Note that both the JBOSS_BIND_ADDR and JBOSS_HOST lines have been changed.

    Other than that, thanks a lot for a great guide!
    Last edited by JeppeM; February 25th, 2009 at 01:36 PM.

  9. #19
    Join Date
    May 2009
    Beans
    3

    PROBLEM Installing jboss as daemon

    Hello,

    I have problems trying to autoboot JBoss 4.2.3 + Portal 2.7.2 on Ubuntu server 9.0.4 (on VirtualBox).

    I have done the steps explained in this thread.

    Jboss booting halts: "Runtime shutdown hook called, forceHalt: true" and then it shuts down.

    The script starts ok from console: sudo /etc/init.d/jboss start

    My hosts file and permissions to jboss directories seem to be ok.

    Any idea what is wrong?


    Console log:

    Here we go
    Setup the JVM
    Setup the JVM classpath
    Set stuff
    Set native path
    ================================================== =======================

    JBoss Bootstrap Environment

    JBOSS_HOME: /home/jboss/jboss-portal-2.7.2

    JAVA: /usr/lib/jvm/java-1.5.0-sun-1.5.0.18/bin/java

    JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true

    CLASSPATH: /home/jboss/jboss-portal-2.7.2/bin/run.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.18/lib/tools.jar

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

    18:34:34,773 INFO [Server] Starting JBoss (MX MicroKernel)...
    18:34:34,780 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)
    18:34:34,781 INFO [Server] Home Dir: /home/jboss/jboss-portal-2.7.2
    18:34:34,781 INFO [Server] Home URL: file:/home/jboss/jboss-portal-2.7.2/
    18:34:34,781 INFO [Server] Patch URL: null
    18:34:34,782 INFO [Server] Server Name: default
    18:34:34,782 INFO [Server] Server Home Dir: /home/jboss/jboss-portal-2.7.2/server/default
    18:34:34,782 INFO [Server] Server Home URL: file:/home/jboss/jboss-portal-2.7.2/server/default/
    18:34:34,782 INFO [Server] Server Log Dir: /home/jboss/jboss-portal-2.7.2/server/default/log
    18:34:34,782 INFO [Server] Server Temp Dir: /home/jboss/jboss-portal-2.7.2/server/default/tmp
    18:34:34,802 INFO [Server] Root Deployment Filename: jboss-service.xml
    18:34:35,483 INFO [ServerInfo] Java version: 1.5.0_18,Sun Microsystems Inc.
    18:34:35,483 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_18-b02,Sun Microsystems Inc.
    18:34:35,483 INFO [ServerInfo] OS-System: Linux 2.6.28-11-generic,i386
    18:34:36,777 INFO [Server] Core system initialized
    18:34:44,067 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
    18:34:44,069 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
    18:34:44,090 INFO [Server] Runtime shutdown hook called, forceHalt: true
    18:34:44,090 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
    ...

    Thanks!

  10. #20
    Join Date
    May 2009
    Beans
    3

    PROBLEM Installing jboss as daemon

    double post (because of refresh, sorry)
    Last edited by m2000; May 9th, 2009 at 05:33 PM. Reason: double post (because of refresh, sorry)

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •