How do I return hung/stuck license keys back to the network license manager / How do I use the lmremove function?

126 次查看(过去 30 天)
After quitting the MATLAB session, the license manager still reports that the license is checked out. How do I return the hung license key to the license server?

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2023-9-13
Occasionally, license keys may not be checked back into the pool of available license keys even though the MATLAB session has ended. This would most likely happen as a result of a system crash. If this is the case it is advisable to restart the FLEXnet license manager.
It is also possible to manually check back hung/stuck license keys into the available pool by using the "lmremove" utility. If the MATLAB session is still running, the lmremove command will not work. In that case, you will need to end the MATLAB session to return the license key.
In order to use lmremove, you must first get the output of lmstat. To obtain this output, you can perform the following steps:

 

For Windows
1. Launch lmtools.exe located in $MATLAB\etc\win{32|64} ($MATLAB\flexlm for releases prior to 2010b) on the license server (where $MATLAB is the installation folder for MATLAB on that machine)
2. Go to the "Server Status" tab.
3. Click perform Status Enquiry button.

 

For Linux/macOS
1. Open a terminal window (for MAC, Terminal is located in Applications/Utilities)
2. Change directories to MATLAB's etc folder in the terminal by running the following command:
cd $MATLAB/etc
Where $MATLAB is the installation folder for MATLAB (for Mac OS X with R2008b or higher, $MATLAB is generally /Applications/MATLAB_R2022a.app).
3. Run the following command to obtain the lmstat output:
./lmstat -a
Both the lmstat and the lmtools, will list all of the users that have checked out licenses. For example:
License server status: 27000@server1
License file(s) on server1: C:\Program Files\MATLAB\R2010b\etc\license.dat:
server1: license server UP (MASTER) v11.4
Vendor daemon status (on server1):
MLM: UP v11.6.1
Feature usage info:
Users of MATLAB: (Total of 10 licenses issued; Total of 1 licenses in use)
"MATLAB" v20, vendor: MLM
nodelocked license, locked to "ID=123456"
johndoe johnpc johnpc (v20) (johnpc/27000 101), start Wed 3/11 10:06
The lmstat will output the username, then the computer name, and then the display name (usually the display is the same as the computer name). In order to use lmremove, you will need the feature name (ex: MATLAB), the host (computer name) and the display name.

 

To use lmremove, you will need to run the command (where <path to license file> is the path to the license.dat file):
lmremove [-c <path to license file>] feature Entry1(user) Entry2(host) Entry3(display)

 

For Linux/Mac, lmremove is located in $MATLAB/etc. Thus, if you followed the steps above, you can execute it by running:
./lmremove [-c <path to license file>] feature Entry1(user) Entry2(host) Entry3(display)
Using the example above, to remove johndoe's license, you would run the following:
./lmremove -c license.dat MATLAB johndoe johnpc johnpc

 

For Windows, to access lmremove, you will need to use a Windows command prompt. To run lmremove, you can take the following steps:
1. Open up a Windows Command Prompt by clicking on the Start Menu and go to All Programs, Accessories, and click on Command Prompt.
2. In the Command Prompt, change directories to the MATLAB's flexlm folder. For example:
cd C:\Program Files\MATLAB\R2010b\etc\win32
3. Launch lmremove through the lmutil.exe executable:
lmutil.exe lmremove -c license.dat (feature) (user) (host) (display)
Thus, for our example above, you would run:
lmutil.exe lmremove -c license.dat MATLAB johndoe johnpc johnpc
NOTE: If the username contains a space, you will find an error stating 'lmremove doesn't exist. The name will need to have quotes added:
lmutil.exe lmremove -c license.dat MATLAB "john doe" johnpc johnpc

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Manage Products 的更多信息

标签

尚未输入任何标签。

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by