2.2.3. Installing and Configuring the RSM Launcher Service for Linux

When installing the RSM launcher service on Linux, you can start the service manually via startup scripts, or install it as a daemon that will start the service automatically when the machine is booted.

The following RSM configuration topics for Linux are discussed in this section:

2.2.3.1. Adding Common Job Environment Variables for Jobs

Before installing and starting the RSM launcher service on Linux, you can edit the rsm_env_profile file under the [RSMInstall]/Config/tools/linux directory. In this file, you can add any common job environment variables for jobs to run. For example, you can use this file to source environment variables specific to a batch-queuing system, or you can append a cluster-specific PATH. Once defined, RSM launcher service and native jobs should inherit these environments when any job is run. It is useful to be able to set common environment variables in a single place instead of having to set them up on each job user's .cshrc or .profile file from the user’s $HOME directory.

The following shows the content of rsm_env_profile file:

#!/bin/sh

# The following examples show loading environment settings specific to batch system (for example, LSF, Altair Grid Engine).
# If defined, RSM service and jobs should then inherit this environment when a job is run.

# . /home/batch/lsf7.0/conf/profile.lsf
# . /home/batch/SGE6.2u2/default/common/settings.sh

Note:
  • This profile only works on Linux. Windows users should modify their environment via the environment interface in Windows.

  • This profile only works when jobs are submitted to a remote HPC resource in non-SSH mode. It does not work when running jobs locally (for example, on localhost using the local queue), or if SSH is being used.

  • This profile can only be written in /bin/sh->bash.


2.2.3.2. Installing the RSM Launcher Service for Linux

When installing the RSM launcher service on Linux, you must determine if you want to install it as a daemon that will start the service automatically when the machine is booted, or if you want to start the service manually via a startup script. Use only one of these methods.

When the RSM launcher service is started manually, it runs as a process for the user who initiated the service. A manually started RSM launcher service is stopped each time the machine is rebooted; after a reboot, before you submit any jobs to RSM you must first restart the RSM launcher service by running the startup script. For security reasons, it is recommended that you do not start and run the RSM launcher service process manually as the "root" user.

If you would prefer to start the RSM launcher service automatically when the machine is booted, you can configure a daemon as described in Starting the RSM Launcher Service Automatically at Boot Time for Linux.


Note:  When installing RSM to a multi-user Linux machine, Ansys strongly recommends that you set up RSM as a daemon (see Starting the RSM Launcher Service Automatically at Boot Time for Linux). Running RSM as a daemon allows you to maintain consistent settings. If RSM is not run as daemon, the settings vary depending on which user first starts RSM processes.


2.2.3.2.1. Starting the RSM Launcher Service Manually for Linux

When jobs are to be submitted to a remote resource, the RSM launcher service must be running on the HPC submit host. You can start the RSM launcher service manually by running the rsmlauncher script.

This script is generated as part of the RSM installation process and is located in the [RSMInstall]/RSM/Config/tools/linux directory. If for some reason this script was not generated during installation or is for other reasons not available, you can generate it yourself. For instructions, see Generating the RSM Service Startup Script for Linux in the RSM Troubleshooting section.

2.2.3.2.1.1. Manually Running the RSM Launcher Service Script for Linux

You can run the RSM launcher service script to manually start, stop, check the status of, and restart the RSM launcher service.

Starting the RSM Launcher Service Manually

You can start the RSM launcher service manually by running the service script with the command line option start, as shown below:

[RSMInstall]/RSM/Config/tools/linux/rsmlauncher start


Note:  Running this script will close any open RSM processes.


Stopping the RSM Launcher Service Manually

You can stop the RSM launcher service manually by running the service script with the command line option stop, as shown below:

[RSMInstall]/RSM/Config/tools/linux/rsmlauncher stop

Checking the Status of the RSM Launcher Service Manually

You can check the status of the RSM launcher service manually by running the service script with the command line option status, as shown below:

[RSMInstall]/RSM/Config/tools/linux/rsmlauncher status

Restarting the RSM Launcher Service Manually

You can restart the RSM launcher service manually by running the service script with the command line option restart, as shown below:

[RSMInstall]/RSM/Config/tools/linux/rsmlauncher restart

2.2.3.2.2. Starting the RSM Launcher Service Automatically at Boot Time for Linux

You can configure the RSM launcher service to start automatically when the machine is booted by configuring it as a “daemon” service (if the service is not configured to start automatically, then it must be started manually, as described in Starting the RSM Launcher Service Manually for Linux). Daemon services are scripts or programs that run persistently in the background of the machine, and which are usually executed at startup by the defined runlevel.

2.2.3.2.2.1. Installing the RSM Automatic Startup (Daemon) Service for Linux
Security Requirements for Daemon Service Configuration

To install the RSM launcher service as a daemon, you must have system administrative permissions (that is, you must be logged in and installing as a “root” user or “sudoer”).

For security reasons, it is recommended that you do not run the RSM launcher service as the root user. Many Linux versions allow only root users to listen to specific ports, so the ports that are required by RSM may be blocked by system administration. For these reasons, the RSM daemon service installation will create a non-root user account with no logon called rsmadmin; the account is a member of the rsmadmins user group, and has a home directory of /home/rsmadmin. The RSM daemon service will then be run by the rsmadmin user.


Note:
  • The RSM daemon service installation will only create the rsmadmin user account if the account does not already exist. The same is true for the rsmadmins user group if the group name does not exist. The account/group will be created locally on the computer on which the RSM launcher service will be run. If you want the account/group to be managed in the master server by Network Information Service (NIS), you need to ask your IT department to create an rsmadmin user account and rsmadmins group from NIS before running the RSM daemon service script.

  • When an RSM package is installed under a directory, make sure that all its parent directories (not the files in the directory) have both read and execution permissions so that the RSM launcher service executable can be started by a non-root user.


Daemon Service Installation Methods

There are two ways to install the RSM launcher service as a daemon: by running the rsmconfig script, or by running the install_daemon script. The difference between the two methods is that whereas the rsmconfig script always generates a fresh service script before starting the service installation, the install_daemon script assumes that the service script is always available in the WBInstallDir/RSM/Config/tools/linux directory and uses the existing script for service installation, allowing the system administrator to perform advanced script customizations before the service is installed.)

Both scripts are located in the RSM/Config/tools/linux directory and have the same command line option.

tools/linux#> ./rsmconfig -help 
Options: 
     -launcher: Install RSM Launcher service.
tools/linux# ./install_daemon
Usage: ./install_daemon [-launcher]
Options:
   -launcher: Install RSM Launcher service.
Installing the RSM Launcher Service as a Daemon

To install the RSM launcher service as a daemon service, run either the rsmconfig script or the install_daemon script, as follows:

  1. Log into a Linux account with administrative privileges.

  2. Ensure that Ans.Rsm.* processes are not running.

  3. Open a terminal window in the RSM/Config/tools/linux directory.

  4. Enter the script into the terminal window, adding the command line option -launcher. For example:

    tools/linux#> ./rsmconfig -launcher
    tools/linux#> ./install_daemon -launcher
  5. Run the command.

Once the daemon service is installed, the RSM launcher service will be started automatically without rebooting. The next time the machine is rebooted, the installed RSM launcher service will be started automatically.

Verifying the RSM Daemon Installation

To verify that the automatic boot procedure is working correctly, reboot the system and check to see that the service is running by typing the appropriate ps command and looking for Ans.Rsm in the resulting display:

ps aux | grep Ans.Rsm
2.2.3.2.2.2. Working with the RSM Automatic Startup (Daemon) Service for Linux

Once the RSM daemon service is configured, any user can check the status of the service. System administrators can also start or restart the service.

Stopping the Daemon Service

To stop the daemon service:

./etc/init.d/rsmlauncher242 stop
Checking the Status of the Daemon Service

To check the status of the daemon service:

./etc/init.d/rsmlauncher242 status
Restarting the Daemon Service

To restart the daemon service:

./etc/init.d/rsmlauncher242 restart

Important:  If you change any system environment variables, you must restart the RSM launcher service in order for the changes to take effect. If you change your user environment variables, make sure that you end your Ans.Rsm.UPHost.exe processes (if any) on the affected machine before trying to run jobs again.