Previous Topic: JBoss Windows Service Fails to StartNext Topic: Installing CA GovernanceMinder and Oracle RAC


Configure JBoss as a Linux Daemon

When you configure the JBoss application daemon as a web service, it automatically launches when you restart the computer.

Follow these steps:

  1. Copy the jboss_linux_service.sh file from the CA GovernanceMinder installation package, located in this directory;
    gm_install/eurekify-jboss/bin/
    

    To the following directory:

    /etc/init.d
    

    Note: gm_install is the CA GovernanceMinder installation directory.

  2. Rename the file JBoss.
  3. Open the jboss_linux_service.sh file for editing, and replace all instances of gm_install with the actual installation path.
  4. Verify the file permissions.

Example: Configure JBoss as a Linux Daemon Script

This example shows you how to create a script to configure JBoss as a Linux daemon.

  1. Copy and paste the following script in this directory:
    /etc/rc.d/init.d
    
  2. As root (su - root) type vi /etc/rc.d/init.d/jboss and paste as follows:
    #! /bin/sh
    
    
    start(){
            echo "Starting jboss.."
            su -l root -c ' gm_install/eurekify-jboss/bin/eurekify.sh  > /dev/null 2> /dev/null &'
    }
    
    stop(){
            echo "Stopping jboss.."
            su -l root -c ' gm_install/eurekify-jboss/bin/shutdown.sh -S &'
    }
    restart(){
            stop
    # give stuff some time to stop before we restart
            sleep 60
    # protect against any services that cannot stop before we restart (warning this kills all Java instances running as 'jboss' user)
            su -l root -c 'killall java'
            start
    }
    
    case "$1" in
      start)
            start
            ;;
      stop)
            stop
            ;;
      restart)
            restart
            ;;
      *)
            echo "Usage: jboss {start|stop|restart}"
            exit 1
    esac
    exit 0
    
  3. Change the permissions of the file with the following command:
    chmod 0755 /etc/init.d/jboss
    
  4. Create links that you use to identify JBoss start and stop run levels.

    For example, (create as root):

    ln -s /etc/rc.d/init.d/jboss /etc/rc3.d/S84jboss
    
    ln -s /etc/rc.d/init.d/jboss /etc/rc5.d/S84jboss
    
    ln -s /etc/rc.d/init.d/jboss /etc/rc4.d/S84jboss
    
    ln -s /etc/rc.d/init.d/jboss /etc/rc6.d/K15jboss
    
    ln -s /etc/rc.d/init.d/jboss /etc/rc0.d/K15jboss
    
    ln -s /etc/rc.d/init.d/jboss /etc/rc1.d/K15jboss
    
    ln -s /etc/rc.d/init.d/jboss /etc/rc2.d/K15jboss
    
  5. Test the script by running it with the following commands:
    Run JBoss:
    
    /etc/init.d/jboss start
    

    The CA GovernanceMinder server becomes available in a few moments.

    Stop JBoss:
    
    /etc/init.d/jboss stop
    

    You have configured the JBoss application daemon as a web service, and it automatically launches when you restart the computer.