+

Search Tips | Advanced Search

Guidance for running an MFT agent or logger as a Windows service

We can run a Managed File Transfer agent, a stand-alone database logger, and a stand-alone file logger, as Windows services. If we are having a problem with these Windows services, we 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 MFT agent as a Windows service and fteModifyLogger: run an MFT logger as a Windows service.

Note: If the redistributable agent is going to run as a Windows service, then the BFG_DATA environment variable needs to be set in the system environment for the service to work.


Location of log files

When we use the fteCreateAgent, fteCreateCDAgent, fteCreateBridgeAgent, fteModifyAgent, fteCreateLogger, or fteModifyLogger command to run an agent or logger as a Windows service, we 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 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 we 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 we are using to run the Windows service are shown in the log file in plain text.


Number of log files

When we use the fteCreateAgent, fteCreateCDAgent, fteCreateBridgeAgent, fteModifyAgent, fteCreateLogger,or fteModifyLogger command to run an agent or a stand-alone logger as a Windows service, we can choose the number of log files by using the -sj parameter. Specify the following text as part of our 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 we want expressed as a positive integer. If we do not specify the number of log files, the default is five.


"Log on as a service" authority

The Windows account that we 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 we are using a user account that does not have this right, a Services window opens. If the service we 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 we 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 we 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 we 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, 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, 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 we 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 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 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 and fteModifyLogger.
  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 Managed File Transfer Version 7.5.0, Fix Pack 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 IBM MQ Java runtime.

Parent topic: MFT general troubleshooting


Related information

Last updated: 2020-10-04