Search

3.6. Configuring the Server as a Service

download PDF
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.
  1. Copy the rhq-server.sh script into the /etc/init.d/ directory.
    cp serverRoot/bin/rhq-server.sh /etc/init.d/
  2. Edit the /etc/init.d/rhq-server.sh script to set the RHQ_SERVER_HOME variable to the JBoss ON server install directory and the RHQ_SERVER_JAVA_HOME variable 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/
  3. Edit the /etc/init.d/rhq-server.sh script, 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.sh
    The last two numbers in the #chkconfig: 2345 95 20 line specify the start and stop priority, respectively, for the JBoss ON server.
  4. Add the service to the chkconfig service management command, and verify that it was added properly.
    chkconfig --add rhq-server.sh
    chkconfig rhq-server.sh --list
  5. Set the rhq-server.sh service to run at run level 5.
    chkconfig --level 5 rhq-server.sh on
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.