Red Hat Training

A Red Hat training course is available for Red Hat Fuse

14.2. Running JBoss Fuse as a Service on a Headless Server

Prerequisites

  • Install JBoss EAP 6 or later
  • Administrator privileges on the server are required.

Summary

Use the following procedure to install JBoss Fuse as a service on Red Hat Enterprise Linux when the installation has been done using the graphical installer.

Procedure 14.1. Setup the Service

  1. Locate the start-up script and configuration file

    The start-up script and an associated configuration file are located in the EAP_HOME/bin/init.d/ directory. Open the configuration file jboss-as.conf to edit it.
  2. Customize the start-up options in the jboss-as.conf file

    There are several options within the jboss-as.conf file. At the minimum, specify the correct values for JBOSS_HOME and the JBOSS_USER variables. If these variables are absent, add them.
  3. Copy files into system directories

    1. Copy the modified configuration file to the /etc/jboss-as directory.
      [user@host init.d]$ sudo mkdir /etc/jboss-as
      [user@host init.d]$ sudo cp jboss-as.conf /etc/jboss-as/
    2. Copy the start-up script to the /etc/init.d directory.
      [user@host init.d]$ sudo cp jboss-as-standalone.sh /etc/init.d
  4. Add the start-up script as a service.

    Add the new jboss-as-standalone.sh service to list of automatically started services, using the chkconfig service management command.
    [user@host init.d]$ sudo chkconfig --add jboss-as-standalone.sh
  5. Start the service.

    Test that the service has been installed correctly by using the standard syntax for starting Red Hat Enterprise Linux services.
    [user@host bin]$ sudo service jboss-as-standalone.sh start
    If everything has gone correctly, you should get a green [OK]. If you get an error, check the error logs and make sure your paths are correct in the configuration file.
  6. Make the service start automatically when you restart your server.

    To add the service to the list of services which start automatically when your server restarts, issue the following command.
    [user@host init.d]$ sudo chkconfig jboss-as-standalone.sh on

Result

JBoss Fuse starts automatically when Red Hat Enterprise Linux reaches its default run-level, and stops automatically when the operating system goes through its shutdown routine.