I would like to start or stop the network license manager for my MathWorks products.
MATLAB: How to start or stop the Network License Manager
MATLAB
Related Solutions
To update the Network License Manager, you must first obtain the updated License File then install the updated License Manager software using the MathWorks Installer or manually update the License Manager binaries.
The following instructions are for:
- Obtaining the update License File
- Updating the License Manager using MathWorks Installer
- Manually updating the License Manager using the binaries
Obtaining the updated License File (Required)
Updating the network license manager requires that the license server already be activated on the MathWorks website.
To obtain the updated license file:
- Open the license in the License Center
- Click the "Install and Activate" tab
- Under 'Get License File,' click the down arrow to download the license file or the envelope to email the license file.
If you see "Activate to Retrieve License File," then you will need to activate the license. For information on installing the License Manager with a new network license, please refer to the following article:
If you are transferring the license to a new license server, you will be required to first deactivate before reactivating to the new license server:
Updating the License Manager using MathWorks Installer
Using the MathWorks Installer to update the license manager is recommended for new license administrators. Compared to updating the license manager manually, it takes longer but is less error-prone.
1) Stop the current License Manager service
(Windows Machines only) Stop and remove the service
On Windows, the existing license manager service must be removed before the installer can be used to create a new one.
To remove the existing service:
- Open the MATLAB installation folder.
- Open the folder "etc\win64."
- Start "lmtools.exe."
- Go to the "Start/Stop/Reread" tab.
- Click "Stop Server."
- Go to the "Config Services" tab.
- Click on the "Service Name" drop down menu, and select the service you would like to remove.
- Click "Remove Service."
- Reboot the server to save the changes to your registry.
(Linux and MacOS) Stop Server
Linux and MacOS do not share Windows' concept of services. Instead, use the lmdown script to stop the license manager before proceeding.
2) Download and run the MathWorks Installer
The license manager installer is part of the MathWorks Installer. The MathWorks Installer can be downloaded here. Once you have the installer:
- Start the MATLAB installer.
- Click 'Advanced Options' at the top right.
- Select 'I want to install Network License Manager'
- Accept the terms of the Software License Agreement.
- When prompted for a license file, browse to the "license.lic" file that you downloaded from the MathWorks License Center.
- Select the destination folder
- To start the license manager to start at boot time, select "Configure the license manager as a service" (Windows only.)
- Click "Begin Install."
You may now start the License Manager as you had prior to the update.
NOTE: When updating the License Manager with the MathWorks Installer, the license.dat generated will not include the changes made to the SERVER line from your old license.dat. You may need to replace the SERVER line from your updated license.dat with the SERVER line from the outdated license.dat.
The old license manager will still be in the folder it was originally installed in. Now that the updated license manager has been installed, you may delete this folder.
Manually updating the License Manager using the binaries
If you are serving multiple vendors from your FlexLM server, or you simply prefer to do things manually, the license manager can be updated without using the MATLAB installer. While updating the license manager manually is faster than using the MathWorks Installer, it is more error prone and only recommended for experienced license administrators.
First, you must download the License Manager binaries. The license manager binaries can be downloaded here.
The license manager consists of three binaries, or four for Windows machines:
- lmgrd, the core license manager binary
- mlm, the MATLAB vendor daemon
- lmutil, a suite of tools for administering the license manager
- lmtools.exe, a graphical frontend for the license manager. (Windows only)
To update the license manager:
- Stop the license manager. On Windows machines, remove the License Manager service.
- Replace the binaries on the server with the ones you downloaded above.
- Update the license file.
You may now start the License Manager using the startup scripts.
When contacting us through a service request, please provide the license.dat and the debug log (lmlog). You may also find the help you need by visiting our support page!
By default, the usage of lmdown, lmremove and lmreread can be performed by any user with access to the network license manager. To restrict these functions see the information below:
On Windows, the lmtools.exe utility contains options to prevents users from stopping the license manager, removing licenses, or rereading the license.dat and options files. These options can be accessed by following these steps:
1. Launch $MATLAB\etc\win{32|64}\lmtools.exe. ($MATLAB\flexlm for releases prior to 2010b
2. Choose the "Start/Stop/Reread" tab.
3. Click the Advanced settings button to expand the options.
NOTE: $MATLAB refers to the installation folder for MATLAB on the license manager.
Under Start Server Options there are three checkboxes which can be checked to prevent lmdown from being run on any machine other than the one running the license manager, disable lmdown or lmreread.
For a Unix/Linux/Mac system there are command line switches to prevent access to lmdown, lmremove and lmreread. To use these switches, the license manager must be started with the lmgrd binary directly. You will not be able to use lmstart or lmboot to make these changes. To start the license manager with lmgrd, you must use the following command:
$MATLAB/etc/$ARCH/lmgrd - c <path to license file> -l <path to log>
- $MATLAB refers to the installation folder for MATLAB on the license manager
- $ARCH refers to the folder for the architecture you are using (Ex: glnx86, glnxa64, maci, sol, etc.)
- "path to license file" refers to the path of the license file on the computer
- "path to log" refers to the path of the log file that will be written (The default log is /var/tmp/lm_TMW.log)
For example, to start the license manager on 64-bit Linux:
/usr/local/matlab/etc/glnxa64/lmgrd - c /usr/local/matlab/etc/license.dat -l /var/tmp/lm_TMW.log
Once you change the method of starting the license manager, you can use the following flags with lmgrd to restrict usage:
-x lmremove: Disables lmremove function
-x lmdown: Disables lmdown completely (license manager process must be killed manually)
-local: Restricts access to lmdown to the computer where lmgrd is Running
-2 -p: The -2 -p switch restricts usage of lmdown, lmreread, and lmremove to a FLEXlm administrator who is by default root.
For the -2-p option, if there a UNIX group called lmadmin, then usage is restricted to only members of that group. If root is not a member of this group, then root does not have permission to use any of the above utilities. With this configuration, users attempting to change the license manager who are not part of the lmadmin group will receive the following error message:
Shutdown failed: You are not a license administrator (-63,214)
Related Question
- How to update MATLAB installations using a Designated Computer license if the account does not have administrative or superuser permissions
- How to change the activation of a MATLAB installation from Individual or Designated Computer to Concurrent
- Do I get a Service Error when reinstalling the network license manager on Windows
- Do I receive License Manager Error -13
- How to tell what version of Network License Manager I’m using
- Can I perform a silent install of the network license manager for R2020a and newer
- How to install the Network License Manager
Best Answer