이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 2. Installing Red Hat JBoss Fuse as a Service


Abstract

This chapter provides information on how you can start the Red Hat JBoss Fuse instance as a system service by using the templates.

2.1. Overview

By using the Service Script templates, you can run a fuse instance with the help of operating system specific init scripts. You can find these templates under the bin/contrib directory.

2.1.1. Running Fuse as a Service

The karaf-service.sh utility helps you to customize the templates. This utility will automatically identify the operating system and the default init system and generates ready to use init scripts. You can also customize the scripts to adapt them to its environment, by setting JAVA_HOME and few other environment variables.
The generated scripts are composed by two files:
  1. the init script
  2. the init configuration file

2.1.2. Customizing karaf-service.sh Utility

You can customize the karaf-service.sh utility, by defining an environment variable or by passing command line options:
Expand
Table 2.1. 
Command Line OptionEnvironment VariableDescription
-k KARAF_SERVICE_PATH Karaf installation path
-d KARAF_SERVICE_DATA Karaf data path (default to \${KARAF_SERVICE_PATH}/data)
-c KARAF_SERVICE_CONF Karaf configuration file (default to \${KARAF_SERVICE_PATH/etc/\${KARAF_SERVICE_NAME}.conf)
-t KARAF_SERVICE_ETC Karaf etc path (default to \${KARAF_SERVICE_PATH/etc})
-p KARAF_SERVICE_PIDFILE Karaf pid path (default to \${KARAF_SERVICE_DATA}/\${KARAF_SERVICE_NAME}.pid))
-n KARAF_SERVICE_NAME Karaf service name (default karaf)
-e KARAF_ENV Karaf environment variable
-u KARAF_SERVICE_USER Karaf user
-g KARAF_SERVICE_GROUP Karaf group (default \${KARAF_SERVICE_USER)
-l KARAF_SERVICE_LOG Karaf console log (default to \${KARAF_SERVICE_DATA}/log/\${KARAF_SERVICE_NAME}-console.log)
-f KARAF_SERVICE_TEMPLATE Template file to use
-x KARAF_SERVICE_EXECUTABLE Karaf executable name (defaul karaf support daemon and stop commands)
CONF_TEMPLATE="karaf-service-template.conf"
SYSTEMD_TEMPLATE="karaf-service-template.systemd"
SYSTEMD_TEMPLATE_INSTANCES="karaf-service-template.systemd-instances"
INIT_TEMPLATE="karaf-service-template.init"
INIT_REDHAT_TEMPLATE="karaf-service-template.init-redhat"
INIT_DEBIAN_TEMPLATE="karaf-service-template.init-debian"
SOLARIS_SMF_TEMPLATE="karaf-service-template.solaris-smf"

Copy to Clipboard Toggle word wrap

2.1.3. Systemd

When the karaf-service.sh utility identifies Systemd, it generates three files:
  • a systemd unit file to manage the root Apache Karaf container
  • a systemd environment file with variables used by the root Apache Karaf container
  • a systemd template unit file to manage Apache Karaf child containers
Here is an example:
$ ./karaf-service.sh -k /opt/karaf-4 -n karaf-4
Writing service file "/opt/karaf-4/bin/contrib/karaf-4.service"
Writing service configuration file ""/opt/karaf-4/etc/karaf-4.conf"
Writing service file "/opt/karaf-4/bin/contrib/karaf-4@.service"
$ cp /opt/karaf-4/bin/contrib/karaf-4.service /etc/systemd/system
$ cp /opt/karaf-4/bin/contrib/karaf-4@.service /etc/systemd/system
$ systemctl enable karaf-4.service
Copy to Clipboard Toggle word wrap

2.1.4. SysV

When the karaf-service.sh utility identifies a SysV system, it generates two files:
  • an init script to manage the root Apache Karaf container
  • an environment file with variables used by the root Apache Karaf container
Here is an example:
$ ./karaf-service.sh -k /opt/karaf-4 -n karaf-4
Writing service file "/opt/karaf-4/bin/contrib/karaf-4"
Writing service configuration file "/opt/karaf-4/etc/karaf-4.conf"
$ ln -s /opt/karaf-4/bin/contrib/karaf-4 /etc/init.d/
$ chkconfig karaf-4 on
Copy to Clipboard Toggle word wrap
Note
To enable the service startup upon boot, Refer your operating system init guide.

2.1.5. Solaris SMF

When the karaf-service.sh utility identifies a Solaris operating system, it generates a single file.
Here is an example:
$ ./karaf-service.sh -k /opt/karaf-4 -n karaf-4
Writing service file "/opt/karaf-4/bin/contrib/karaf-4.xml"
$ svccfg validate /opt/karaf-4/bin/contrib/karaf-4.xml
$ svccfg import /opt/karaf-4/bin/contrib/karaf-4.xml

Copy to Clipboard Toggle word wrap
Note
The generated SMF descriptor is defined as transient, so that you can execute the start method only once.

2.1.6. Windows

Installation of Apache Karaf as windows service is supported through winsw.
To install Apache Karaf as windows service, perform the following:
  • Rename the karaf-service-win.exe file to karaf-4.exe file.
  • Rename the karaf-service-win.xml file to karaf-4.xml file.
  • Customize the service descriptor as per your requirements.
  • Use the service executable to install, start and stop the service.
Here is an example:
C:\opt\apache-karaf-4\bin\contrib> karaf-4.exe install
C:\opt\apache-karaf-4\bin\contrib> karaf-4.exe start

Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat