MATLAB: Does starting the network license manager result in the error message “(lmgrd) Retrying socket bind”

MATLAB

Attempting to start the network license manager results in the following error messages in the log file:
mm/dd hh:mm (lmgrd) Retrying socket bind (address in use: port ####)
where mm/dd hh:mm is the Time that the message was logged, lmgrd is the Name of the license manager daemon, and #### is the specified TCP Port number, usually 27000.

Best Answer

This problem can usually be resolved with one of following cases:
CASE #1
*********
The $MATLABROOT/etc/lmdown script ($MATLABROOT refers to the root MATLAB directory) did not successfully kill all of the license daemons. You must manually kill these daemons and then attempt to restart the license manager. One way to kill the daemons is:
On UNIX/Linux, find the name of the processes running with the following command:
ps -ef | grep lm
Check the output to see if either lmgrd or MLM (lm_matlab prior to R2011a for Linux/Mac) is running. Kill all of these manually by executing (as root user)
kill -9 <pid of process>
On PC, check the processes to see if lmgrd.exe or MLM.exe are running. If they are running, please end these processes.
CASE #2
*********
The TCP Port number may be in use by another program. The TCP Port number is located at the end of the SERVER line in the $MATLABROOT/etc/license.dat file on UNIX/Linux and in $MATLABROOT/flexlm/license.dat on Windows. It can be changed with any standard text editor. Check with your system administrator for another port number that you can use in your license file.
CASE #3
*********
In some cases this can occur if you have the $MATLABROOT/etc/license.dat file open in an Emacs editor. It has been found that even though a file has had its changes saved, if the file is still open in Emacs then the License Manager seems to not find the changes. In this case, the solution is to first close the editor, and then restart the license manager.