4 2 Running the Listener Job on the Linux Server

LANSA Communication Set Up

4.2 Running the Listener Job on the Linux Server

The Linux Server has a listener control utility named lcolctl. The utility allows you to start or stop the Listener and to check if the Listener is running.

Before you can use the utility, you need to start a shell command prompt and load the setup script {lansa_root}/x_lansa/bin/setenv.sh. The setup script is targeted for standard shells sh and bash, if you are using other shells, you may need to adapt setenv.sh for the shell that you use.

If you are using standard shells sh or bash, you can set up the command prompt environment for running LANSA for Linux with the following command:

. {lansa_root}/x_lansa/bin/setenv.sh

 

You need to replace {lansa_root} with the directory for your LANSA for Linux installation, e.g. /lansa. The setup script will set a few environment variables, including LANSAXROOT and X_RUN, which are crucial to using LANSA forLinux in a command prompt. The setup script will also updates the command path and shared library path.

To start or stop the listener, you need to use a shell command prompt logged in as root. For other operations, you may log in as any user belongs to the group that owns the installation directory.
To start the Listener, you use the command (must be running as root):

lcolctl start {port}

where {port} is the Listener port number. If you do not specify a port number for the installer, the default port number is 4545. In case you forget what the current port number should be, you can check the configuration file for the Listener listen.dat.

For example:

lcolctl start 4444

if 4444 is the port number of your Listener.

To stop the Listener, you use the similar command (must be running as root):

lcolctl stop {port}

For example:

lcolctl stop 4444

To check if the Listener is running, you use the command:

lcolctl show

If the Listener for the installation is running, for example, you will see something like:

Port  PID  SID
4545 15489

which shows that the Listener is running and listening on port number 4545 and its process id is 15489. Note that the SID column is no longer used in this release and should be usually blank.

You can also use the Linux standard ps command to check for all the Listeners (not just the current installation you are using) running on your system, e.g.:

ps -ef | grep lco

If the Listener is running, for example, on a Linux server, you will see something like:

root     15489     1  0 Jul01 ?        00:00:00 /lansa/connect/lcolist: [monitor]
root     15490 15489  0 Jul01 ?        00:00:00 /lansa/connect/lcolist: listening on port 4545
 

If there are more than one Listeners running on your system, you will see more entries like these.

If the Listener is stopped but it is not properly stopped with the lcolctl stop command, e.g. explicitly terminated by the system shutdown sequence, lcolctl show command may incorrectly show that the Listener is still running. If you attempt to start the Listener again with the lcolctl start command, the command will fail with a message like this:

Port 4545 already in use
 

In this case, you can simply run the lcolctl stop command first, and then restart the Listener with the lcolctl start command.