Guidance for running an agent or logger as a Windows service

You can run a IBM® MQ Managed File Transfer agent, a stand-alone database logger, and a stand-alone file logger, as Windows services. If you are having a problem with these Windows services, you can use the service log files and the information in this topic to diagnose the issue.

For information about configuring your agent, stand-alone logger, or stand-alone file logger, to run as a Windows service, see Starting an agent as a Windows service and fteModifyLogger (run a IBM MQ Managed File Transfer logging application as a Windows service).

Location of log files

When you use the fteCreateAgent, fteCreateWebAgent, fteCreateCDAgent, fteCreateBridgeAgent, fteModifyAgent, fteCreateLogger, or fteModifyLogger command to run an agent or logger as a Windows service, you can choose the level of logging by using the -sl parameter. The possible values for this parameter are error, info, warn, and debug. The default value is info.

The log file for the Windows service has the file name servicedate.log, where date is the date when the service was started. The file for an agent is written to the directory MQ_DATA_PATH\mqft\logs\coordination_qmgr_name\agents\agent_name. This directory is the same directory that IBM MQ Managed File Transfer agent trace files are written to. The file for the logger is written to the directory MQ_DATA_PATH\mqft\logs\coordination_qmgr_name\loggers\logger_name.

If you have problems starting an agent, or a stand-alone logger as a Windows service, try setting the logging level to debug using the -sl parameter. Additional information is written to the servicedate.log file.
Note: When the logging level is set to debug, the user account and password that you are using to run the Windows service are shown in the log file in plain text.

Number of log files

When you use the fteCreateAgent, fteCreateWebAgent, fteCreateCDAgent, fteCreateBridgeAgent, fteModifyAgent, fteCreateLogger,or fteModifyLogger command to run an agent or a stand-alone logger as a Windows service, you can choose the number of log files by using the -sj parameter. Specify the following text as part of your command to change the number of log files: -sj -Dcom.ibm.wmqfte.daemon.windows.windowsServiceLogFiles=number, where number is the number of log files that you want expressed as a positive integer. If you do not specify the number of log files, the default is five.

"Log on as a service" authority

The Windows account that you use to run the service must have the Log on as a service right. If you try to start the service, either with the fteStartAgent, fteStartLogger command, or with the Windows Sc.exe command, and you are using a user account that does not have this right, a Services window opens. If the service you wanted to start was to run an agent, this window contains the following message:

Unable to start Windows service mqmftAgentAGENT@QMGR.
System error 1069: The service did not start due to a logon failure.
In this message, AGENT is your agent name and QMGR is your agent queue manager name. If you are trying to run a stand-alone logger as a service, a similar message is produced, which refers to the logger rather than an agent.
To prevent this error, give the Windows account that you use to run the service the Log on as a service right. For example, on Windows 7 complete the following steps:
  1. From the Start menu, click Administrative Tools > Local Security Policy.
  2. In the Security Settings pane, expand Local Policies, and then click User Rights Assignments.
  3. In the Policy and Security Setting pane, double-click Log on as a service.
  4. Click Add User or Group, and then add the user that you want to run the service to the list of users that have the Log on as a service right. You provided this user name when you ran the fteCreateAgent, fteCreateWebAgent, fteCreateCDAgent, fteCreateBridgeAgent, fteModifyAgent,fteCreateLogger, or fteModifyLogger command.
Note: The error System error 1069: The service did not start due to a logon failure. can also be caused by an incorrect password.

Hiding your Windows account password

When you configure your agent or stand-alone logger to run as a Windows service, you specify a user name and password to use. In the following example, the agent AGENT1 is created, which has an agent queue manager QMGR1 and is configured to run as a Windows service:

fteCreateAgent -agentName AGENT1 -agentQMgr QMGR1 -s -su fteuser -sp ftepassword
In this example, the Windows service runs with a user name of fteuser, which has an associated password ftepassword. When you run the fteCreateAgent command, or one of the other commands that accepts the -s parameter, you specify the password for the Windows account in plain text. If you prefer not to display your password, carry out the following steps:
  1. Run the command (fteCreateAgent, fteCreateWebAgent, fteCreateCDAgent, fteCreateBridgeAgent, fteModifyAgent, fteCreateLoggeror fteModifyLogger) without specifying the -sp parameter. For example:
    
    fteCreateAgent -agentName AGENT1 -agentQMgr QMGR1 -s -su fteuser
    
    Note: The command produces a message that warns you that you must set the password by using the Windows Services tool before the service starts successfully.
  2. Open the Windows Services window.
  3. In the list of services, right-click the agent or stand-alone logger service and select Properties. The agent service display name is WebSphere MQ Managed File Transfer agent AGENT @ QMGR, where AGENT is the agent name and QMGR is your agent queue manager name. The logger service display name is WebSphere MQ Managed File Transfer logger for property set coordination_qmgr_name, where coordination_qmgr_name is the coordination queue manager that you specified for the stand-alone logger to use as its property set. For more information about the property set, see fteStartLogger (start a logger) and fteModifyLogger (run a IBM MQ Managed File Transfer logging application as a Windows service).
  4. In the Properties window, select the Log On tab.
  5. Enter the password for the user account that runs the service in the Password and Confirm password fields. The password characters are hidden as you enter them.
  6. Click OK.

Known issues

Problem using the JAVA_HOME system environment variable (applies to IBM MQ Managed File Transfer V7.5.0.1 or earlier only).
The JAVA_HOME system environment variable must not be set, otherwise the agent or logger Windows Service is unlikely to start. The agent or logger Windows Service must be run with the Websphere MQ Java runtime.