Show Table of Contents
3.6. Configuring the Server as a Service
The
rhq-server.sh script can be managed by the init process so that the server starts automatically when the system boots. This also allows the server process to be managed by services like service and chkconfig.
- Copy the
rhq-server.shscript into the/etc/init.d/directory.cp serverRoot/bin/rhq-server.sh /etc/init.d/
- Edit the
/etc/init.d/rhq-server.shscript to set theRHQ_SERVER_HOMEvariable to the JBoss ON server install directory and theRHQ_SERVER_JAVA_HOMEvariable to the appropriate directory for the JVM. For example:RHQ_SERVER_HOME=serverRoot/jon-server-3.1.2.0.GA1/
RHQ_SERVER_JAVA_HOME=/usr/
- Edit the
/etc/init.d/rhq-server.shscript, and add the following lines to the top of the file, directly under#!/bin/sh.#!/bin/sh #chkconfig: 2345
95 20#description: JBoss Operations Network Server #processname: run.shThe last two numbers in the#chkconfig: 2345 95 20line specify the start and stop priority, respectively, for the JBoss ON server. - Add the service to the
chkconfigservice management command, and verify that it was added properly.chkconfig --add rhq-server.sh chkconfig rhq-server.sh --list
- Set the
rhq-server.shservice to run at run level 5.chkconfig --level 5 rhq-server.sh on

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.