Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 2. Installing Red Hat JBoss Fuse as a Service

Abstract

You can install JBoss Fuse as a system service. To do this, generate a service wrapper, then configure the wrapper for your system, and install and start the service.

2.1. Generating the Service Wrapper

Overview

The Red Hat JBoss Fuse console wrapper feature generates a wrapper around the JBoss Fuse runtime instance. You use the wrapper to install the message broker as a system service. The wrapper feature is not installed by default in the console, so before you can generate the service wrapper you must install the wrapper feature.
After the feature is installed the console gains a wrapper:install command. Running this command generates a generic service wrapper in the JBoss Fuse installation.

Generating the service wrapper

  1. Start JBoss Fuse in console mode with the fuse command.
  2. Enter features:install wrapper.
    The features:install command locates the required libraries to provision the wrapper feature and deploys it into the runtime instance.
  3. Generate the wrapper with the wrapper:install command in the following format:
      wrapper:install -n <serviceName> -d <displayName> -D <<description>
    The Table 2.1, “Wrapper Install Options” table describes the wrapper:install options.

    Table 2.1. Wrapper Install Options

    OptionDefaultDescription
    -sAUTO_START(Windows only) Specifies the mode in which the service is installed. Valid values are AUTO_START or DEMAND_START.
    -nkarafSpecifies the service name that will be used when installing the service.
    -d Specifies the display name of the service.
    -D Specifies the description of the service.
    -i --include Specifies an include statement for the JSW wrapper configuration. To specify multiple include statement, enter this option multiple times.
    -e --env Specifies environment variable and values. To set multiple environment variable and values, enter this option multiple times.

Results

The wrapper:install command generates the following wrapper files:
  • bin\ServiceName-wrapper[.exe]—the executable file for the wrapper.
  • bin\ServiceName-service[.bat]—the script used to install and remove the service.
  • etc\ServiceName-wrapper.conf—the wrapper configuration file.
The command also creates the following libraries that the service wrapper requires:
  • lib\libwrapper.so
  • lib\karaf-wrapper.jar
  • lib\karaf-wrapper-main.jar