Step 7 Create listener startup and shutdown scripts requires root privileges

Install LANSA on Linux

Step 7. Create listener startup and shutdown scripts (requires root privileges)

LANSA provides a script, setenv.sh, that sets up the environment variables required for command line LANSA operations using the standard shell 'sh' or 'bash'. If you use another shell, for example, csh, you will need to create your own script based on setenv.sh. This script must be loaded in a shell prompt (only once is required for the whole live-time of the shell prompt) using the shell dot '.' command before running any LANSA command line in the same shell prompt. A shell prompt running with root privileges is required to submit the command lines to start or stop the LANSA listener.

For example, assuming you are using the standard shell 'bash' for Red Hat Enterprise Linux, the command line to load the script looks like:

. /lansa/x_lansa/bin/setenv.sh

Notice the space between the first dot and the following slash is part of the command line and cannot be omitted.

Alternatively, you may set the LANSAXROOT environment variable first:

LANSAXROOT=/lansa; export LANSAXROOT

. $LANSAXROOT/x_lansa/bin/setenv.sh

 

If any errors are found during the script's execution, error messages will be issued and the scripts return code will be non-zero.

To start the listener (listening at the default port 4545), issue the following command:

lcolctl start

To stop the listener, issue the following command:

lcolctl stop

For further information, please refer to Running the Listener Job on the Linux Server in the LANSA Communications Setup Guide.

Note: Before starting the listener, it is always best to issue the lcolctl  stop command, just in case the listener is still running, or was accidentally killed.

If you want to start/stop the LANSA Listener upon system starts up/shut down, you will need to create your own system service script based on the information above. For Red Hat Enterprise Linux, for example, the system service script is usually located in the directory /etc/init.d. You may following existing scripts there to create your own for the LANSA Listener.