学习中心

How to Start the License Manager for COMSOL Multiphysics®


In this article, we provide a step-by-step guide on how to start the license manager for COMSOL Multiphysics® on Windows®, Linux®, and macOS. After you have installed the license manager, you may need to start it manually or set it to start automatically. The license manager is limited to a single instance; you can combine multiple licenses into a single file to host multiple licenses from a single machine.

ℹ️

For the paths in this guide, replace XY with your version number. Using version 6.4 as an example, C:\ProgramData\COMSOL\comsolXY.logC:\ProgramData\COMSOL\comsol64.log

Start the License Manager on Windows®

The license manager can be started on a Windows machine using FlexNet® Control Panel (LMTOOLS). The steps include:

  1. Locate and run lmtools.exe.
    1. You can use the LMTOOLS shortcut in the COMSOL Launchers directory, or run lmtools.exe directly from the {COMSOLInstallationDirectory}\license\win64 directory. The options in these directories will only be present if the license manager was installed and the {COMSOLInstallationDirectory} was created with the default path C:\Program Files\COMSOL\COMSOLXY\Multiphysics.
  2. Locate the Service/License File tab. Make sure that the Configuration using Services radio button is selected.
    ℹ️

    The following steps outline how to configure the license manager service from scratch. If you installed the license manager as a service using the COMSOL installer, these settings may already be configured. In that case, simply review and verify the settings instead of repeating the steps.

  3. Locate the Config Services tab.
    1. Enter "COMSOL License Manager" in the Service Name field.
    2. Specify the full paths for the required files in their corresponding fields. Below are the default paths for the files used by COMSOL Multiphysics®:
      1. Path to the lmgrd.exe file: C:\Program Files\COMSOL\COMSOLXY\Multiphysics\license\win64\lmgrd.exe
      2. Path to the license file: C:\Program Files\COMSOL\COMSOLXY\Multiphysics\license\license.dat
      3. Path to the debug log file: C:\ProgramData\COMSOL\comsolXY.log
        ℹ️

        If COMSOL was installed in a nondefault location, ensure that the local service account on Windows used to start the license manager has the following permissions:

        • lmgrd — Read and Execute
        • LMCOMSOl (vendor daemon) – Read and Execute
        • License.dat — Read
        • Debug Log File Path — Read and Write
    3. Enable service by checking the Use Services checkbox and then the Start Server at Power Up checkbox.
    4. Finally, click Save Service.
  4. Locate the Start/Stop/Reread tab and click the Start Server button to start the license manager.
  5. Verify that the license manager is running.
    1. Open the details page in the Task Manager
    2. Ensure that lmgrd.exe and LMCOMSOL.exe are running.
    To further verify that the license manager is functioning correctly, review the debug log file for any relevant status messages or errors.

Start the License Manager on Linux®

The license manager can be started on a Linux machine manually or automatically at boot (using systemd).

Automatically vs. Manually Starting the License Manager

Starting a process manually is quick and simple but lacks built-in management features like automatic restarts. In contrast, using systemd provides robust service management, including autostart on boot, making it ideal for long-running services. A straightforward way to decide between these methods is to consider how often the machine hosting the license manager is restarted. If you opt for manual startup, the license manager must be restarted manually after every reboot. Configuring the license manager as a systemd service also enables you to reboot the machine without needing to manually restart the service.

Automatically Start the License Manager on Linux® (Using systemd)

ℹ️

If the license manager has been started manually, it must be stopped before automatically launching the version configured as a systemd service.

In systemd, a service file is used to describe how a specific service should be started and managed. You can find the service file, lmcomsol.service, to start the license manager under {COMSOLInstallationDirectory}/license/glnxa64 or {COMSOLInstallationDirectory}/license/glnxarm64 depending on the processor architecture. 

Reminder: Replace XY with your COMSOL version. 

  1. Open the lmcomsol.service file and verify paths to lmgrd, license.dat, and the log file.
    1. The lmcomsol.service file specifies the following default command that should be run to start the service:
      ExecStart=/usr/local/comsolXY/multiphysics/license/glnxa64/lmgrd -c /usr/local/comsolXY/multiphysics/license/license.dat -L /var/tmp/comsolXY.log
    2. Make sure that the path to the lmgrd, license.dat, COMSOLXY.log files used in the command above is accurate and exists on your machine.
      ℹ️

      If the license manager has been started manually, it must be stopped before automatically launching the version configured as a systemd service.

  2. Specify the user account in the lmcomsol.service file that will initiate the service.
    1. Uncomment and replace the username, as shown in the example line below, with a non-root user. The user must be able to run lmgrd, read the license.dat, and write to the designated log file location.
      #User=username
    2. Save the lmcomsol.service file.
  3. Make sure that the /usr/tmp directory exists and set the permissions.
    mkdir -p /usr/tmp
    chmod 1777 /usr/tmp
    The /usr/tmp directory is used for storing temporary files by license manager.
  4. Stop the existing license manager.
    1. If an older license manager is already installed and running, first stop the existing version with the following command:
      systemctl stop lmcomsol
  5. Note: If you're installing the license manager as a service for the first time on this machine using systemd, you can skip this step.
  6. Activate the license manager with systemd.
    1. Copy the service file to the location /usr/lib/systemd/system/ using the following command. This ensures that systemd can find it.
      cp lmcomsol.service /usr/lib/systemd/system/
    2. Then, enable the service so that it starts automatically on boot.
      systemctl enable lmcomsol
    3. Finally, start the service using the following command:
      systemctl start lmcomsol
  7. Verify the license manager is running.
    1. Use the following systemd command to check the status of the license manager service:
      systemctl status lmcomsol
    2. To further verify that the license manager is functioning correctly, review the debug log file for any relevant status messages or errors.

Manually Start the License Manager on Linux®

After it has been installed, the license manager for COMSOL Multiphysics® is available under:

{COMSOLInstallationDirectory}/license/glnxa64 (x86 64-bit architecture} or glnxarm64 (ARM architecture).

The default location of {COMSOLInstallationDirectory} used by the COMSOL installer on Linux® is /usr/local/comsolXY/Multiphysics (where XY is the version number).

  1. Navigate to the license manager folder.
    cd /usr/local/comsolXY/multiphysics/license/glnxa64
  2. Start the license manager.
    ./lmgrd -c ../license.dat -l /var/tmp/comsolXY.log
    • The command lmgrd starts the license manager.
    • The -c flag specifies the path to the license file (license.dat).
    • The -l flag defines where log file should be stored (comsolXY.log in /var/tmp).
  3. Verify that the license manager is running.
    1. Once the license manager is running, it's good practice to confirm that its processes are active. Run the following commands to check if both LMCOMSOL (vendor daemon) and lmgrd (license server manager) are running.
      ps aux | grep -E "lmgrd|LMCOMSOL"
    To further verify that the license manager is functioning correctly, review the debug log file for any relevant status messages or errors.

Start the License Manager on macOS

The license manager can be started manually or automatically at startup.

Reminder: Replace XY with your COMSOL version. 

Automatically Start the License Manager on macOS:

If the license manager has been started manually, it must be stopped before automatically launching a different version which has been configured as a launchd service. After stopping any existing LM instances, use the following steps to automatically start the license manager on boot.

  1. Copy the template .plist file to /Library/LaunchDaemons depending on your CPU architecture.
    sudo cp /Applications/COMSOL64/Multiphysics/license/macarm64/com.comsol.lmcomsol.plist /Library/LaunchDaemons/
    sudo cp /Applications/COMSOL64/Multiphysics/license/maci64/com.comsol.lmcomsol.plist /Library/LaunchDaemons/
    • Choose the path that matches your CPU architecture.
    • Edit the .plist file to update the lmgrd and license.dat paths, and specify a non-root user to run the service.
  2. Open the .plist file in a text editor to make the necessary edits.
    open -a TextEdit /Library/LaunchDaemons/com.comsol.lmcomsol.plist
       
  3. Set the correct permissions for the .plist file.
    sudo chmod 600 /Library/LaunchDaemons/com.comsol.lmcomsol.plist
  4. Enable and start the daemon.
    sudo launchctl load -w /Library/LaunchDaemons/com.comsol.lmcomsol.plist

Manually Start the License Manager on macOS:

  1. Launch the Terminal application.
  2. Change the directory to the license folder depending on your CPU architecture.
    cd /Applications/COMSOL64/Multiphysics/license/macarm64
    cd /Applications/COMSOL64/Multiphysics/license/maci64
    • Choose the path that matches your CPU architecture.
  3. Start the license manager.
    ./lmgrd -c ../license.dat -l /var/tmp/comsol64.log
    • The lmgrd command starts the license manager.
    • The -c flag specifies the path to the license file (license.dat).
    • The -l flag defines where the log file will be stored (/var/tmp/comsol64.log).

The server is now ready to distribute licenses over the network. It writes any debug information to the log file /var/tmp/comsolXY.log.


请提交与此页面相关的反馈,或点击此处联系技术支持