![[AIX]](ngaix.gif)
Starting an MFT agent at AIX and Linux system startup
A Managed File Transfer Agent can be configured to start at system startup on AIX® and Linux®. When you log off, your agent continues running and can receive file transfers.
When you have created and configured an agent using one of these Managed File Transfer commands; fteCreateAgent, fteCreateCDAgent, or fteCreateBridgeAgent, you can configure it to start automatically during a reboot on AIX and Linux machines by using a script file that simply executes the following command:
su -l mqmft_user -c mq_install_root/bin/fteStartAgent agent_name
Where mq_install_root is the root directory of the required
Managed File Transfer installation, the default is:
/opt/mqm and agent_name is the name of the Managed File Transfer Agent to be started. The use of this script file varies
depending on the specific operating system. For example, there are additional options available
under Linux.![[Linux]](nglinux.gif)
Linux
- Create a file called /etc/rc.mqmft with contents:
Where#!/bin/sh su -l mqmft_user"-c mq_install_root/bin/fteStartAgent agent_name"mqmft_useris the user ID under which the agent process is to run. This user ID must be a member of the mqm group. - Make the file executable, for example:
chmod 755 /etc/rc.mqmft - Next add the following line to /etc/inittab:
mqmft:5:boot:/etc/rc.mqmft
Other ways to start an agent during boot on Linux include adding the script lines to the /etc/rc.d/rc.local file, or on Linux SuSe, adding the script lines to the /etc/init.d/boot.local file. You should select the method that works best for your environment. Here is some more information on other ways to start an agent during startup on specific Linux distributions that are supported:
- SLES 10 and 11
-
For SUSE Linux Enterprise Server (SLES) 10 and 11 systems, follow these steps:
- As the system root user ID, create your own
/etc/init.d/rc.rclocalfile. - Add the following lines to the
rc.rclocalfile:#!/bin/sh ### BEGIN INIT INFO # Provides: rc.rclocal # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Stop: 0 1 2 6 # Description: MQMFT agent startup ### END INIT INFO su -l mqmft_user"-c mq_install_root/bin/fteStartAgent agent_name" - Run the following commands:
chmod 755 rc.rclocal chkconfig --add rc.rclocal
- As the system root user ID, create your own
![[Linux]](nglinux.gif)
Starting Managed File Transfer agents on Linux with systemd
- Create a file in the /etc/systemd/ system folder and name it, for example,
<agentname>.service. Add the following content, where<agentname>isMFT_AGT_LNX_0.# vi /etc/systemd/system/MFT_AGT_LNX_0.service [Unit] Description=IBM MQ MFT MFT_AGT_LNX_0 [Service] ExecStart=/opt/mqm/bin/fteStartAgent MFT_AGT_LNX_0 ExecStop=/opt/mqm/bin/fteStopAgent MFT_AGT_LNX_0 Type=forking User=mqm Group=mqm KillMode=none - To enable the service run the following commands:
# systemctl enable MFT_AGT_LNX_0 # systemctl daemon-reload - To start the agent and check its status, run the following commands:
# systemctl start MFT_AGT_LNX_0 # systemctl status MFT_AGT_LNX_0