2.4.2. Running the Agent as a Windows Service
- Edit the
rhq-agent-wrapper.batscript and set the environment variable to define the system user as whom the init script will run. There are two options:
RHQ_AGENT_RUN_ASexplicitly sets the user account name. This must match the format of a Windows user account name, DOMAIN\username.
RHQ_AGENT_RUN_AS_MEforces the agent to run as whoever the current user is; this uses the format . \ %USERNAME %. If both environment variables are defined, this variable overrides
RHQ_AGENT_RUN_AS, make sure that the given user actually has permission to start services. If necessary, assign the user the appropriate rights. Assigning rights is covered in the Windows documentation.If neither variable is set, the agent init script runs as the System user.Other available environment variables are listed and defined in the comments in the
- Run the
rhq-agent-wrapper.batscript to install the init script as a service. Use the
installcommand to install the init script.
- When prompted, fill in the password for the system user as whom the service will run.
rhq-agent-wrapper.batscript using the
statuscommand shows whether the agent init script is installed as a service and whether it is running. The
removecommand removes the agent init script as a service.
\bin\wrapper\rhq-agent-wrapper.conf, contains the service configuration properties. These are standard wrapper service properties; more information is available at http://wrapper.tanukisoftware.org/doc/english/properties.html.
wrapper.app.parameter.#set command-line options to pass to the agent. These are the same options listed in Section 6.2, “Working with the Agent Command Prompt”. Each option requires its own configuration property. Properties must be placed in numeric order and the first two properties (
wrapper.app.parameter.2) are reserved. Start with
wrapper.java.additional.#set additional JVM options that are passed directly to the VM, corresponding to the
-Xoptions. These also must be incremented numerically.
wrapper.java.additional.1always specifies the log configuration file.
wrapper.ntservice.starttypesets when to start the service. The default is
AUTO_START, which starts the service when the system boots. To start the service manually, the value is