MATLAB Answers

how to start flexlm at boot Mac OS X 10.11

7 views (last 30 days)
Matthew Fasano
Matthew Fasano on 29 Jan 2016
Commented: Matthew Fasano on 12 Feb 2016
How do I have Flexlm start at boot. I tried moving the MATLABLmgr directory to the /Library/StartupItems directory with the appropriate changes to the script MATLABLmgr. I am able to start the flexlm fine manually.
Here is the MATLABLmgr script in /Library/StartupItems
# The MATLAB installer application (InstallForMacOSX) will automatically configure
# and install this script. To install this script manually, perform the following
# actions as an Administrator:
# 1. Navigate via the Finder to the top level /Library folder.
# 2. Create a folder within /Library called StartupItems, if it does not already exist.
# 3. Copy the $MATLAB/etc/MATLABLmgr folder into the StartupItems folder.
# 4. Open /Library/StartupItems/MATLABLmgr/MATLABLmgr with a text editor.
# 5. Change <PATH_TO_MATLAB> to be the location where MATLAB is installed.
# 6. Change <USER_NAME_FOR_LICENSE_MANAGER> to be the short user name under which the
# license manager daemon will be started (for security reasons, this must not be
# "root").
# 7. Save MATLABLmgr back to disk. If your text editor gives you the option to choose
# line ending styles (Macintosh versus UNIX), be sure to choose UNIX line endings.
# 8. Reboot.
. /etc/rc.common
MATLAB=/Applications/ # example: MATLAB=/Applications/
ME=matthewfasano # example: ME=cmoler
StartService ()
### start FLEXnet ###
ConsoleMessage "Starting MATLAB License Manager"
if [ -f $LMBOOT ]; then
# Sleep for a while to make sure all the networking services
# have started up. Otherwise the hostname in the license file
# or the username we are su'ing to might not be resolvable.
sleep 30
$MATLAB/etc/lmboot -u $ME
echo "Cannot locate $LMBOOT"
ConsoleMessage -F
StopService ()
### stop FLEXnet ###
ConsoleMessage "Stopping MATLAB License Manager"
if [ -f $LMDOWN ]; then
echo "Cannot locate $LMDOWN"
ConsoleMessage -F
RestartService ()
### stop then start FLEXnet ###
RunService "$1"

  1 Comment

Matthew Fasano
Matthew Fasano on 12 Feb 2016
using StartupItems will not work. I am now trying to start lmgrd with a LaunchDaemon I put the the following plist file in the directory /Library/LaunchDaemons
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string>MATLAB License Manager</string>
<string>/tmp/MATLAB License Manager.stderr</string>
<string>/tmp/MATLAB License Manager.stdout</string>
The log file suggest it runs fine, but lmgrd is not running.

Sign in to comment.

Answers (1)

Abhisek Roy
Abhisek Roy on 5 Feb 2016
Hi Matthew,
Starting with MATLAB R14, the license manager is configured to start automatically during the installation of the license manager. If you move the installation to a new computer, have an older release of MATLAB, or need to setup the license manager to start, see the instructions below:
The folder $MATLAB/etc/MATLABLmgr contains files that can automatically start the license manager at boot time. By installing and configuring the scripts this folder, you will not have to manually start the license manager after rebooting your machine and/or prior to starting MATLAB. You must be an Administrator to install the scripts in this folder.
Installing the Scripts:
1) Navigate to the top level /Library folder.
2) Create a folder within /Library called StartupItems, if it does not already exist.
3) Copy the $MATLAB/etc/MATLABLmgr folder into the StartupItems folder.
4) Run the Terminal application (/Applications/Utilities) and in the Terminal window enter the commands:
cd /Library/StartupItems/MATLABLmgr ./
5) The script runs and asks you to enter the directory where MATLAB is installed for example:
6) The script will then ask you for your username. You must start the license manager as a non-root user. The license manager cannot be started as root. For example, you can use your own username. To find your username, run 'whoami' command in Terminal.
7) After the script has finished, reboot your machine.
During boot, the message "Starting MATLAB License Manager" should appear on the screen.


Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by