How do I get the Network License Manager to start automatically at boot time on Linux?

110 views (last 30 days)
How do I get the Network License Manager to start automatically at boot time on Linux? I would like the license manager to start automatically every time I reboot my machine.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 Feb 2022
Edited: MathWorks Support Team on 1 Feb 2022
See the MATLAB License Manager documentation for information about starting the license manager at boot:
For instructions on starting services automatically on various Linux distributions, please see the documentation for that distribution. (note: MathWorks does not support these methods. You will need to consult a Linux admin or your local IT support if you have issues with these methods)
RHEL/CentOS 6 and below:
RHEL/CentOS 7 and above:
Debian:
Ubuntu:
SuSE:
  5 Comments
Matt Forrest
Matt Forrest on 21 Apr 2022
The link for Ubuntu is way out of date. It also uses systemd. Can Mathworks provide an official .service template with the license manager install?
I modified the template Richard provided below.

Sign in to comment.

More Answers (4)

Richard Nickle
Richard Nickle on 15 Jun 2017
Edited: Richard Nickle on 15 Jun 2017
https://stackoverflow.com/questions/41254104/systemd-service-unit-file-as-user gave me a great hint.
I ended up using this as a base:
#
# based on:
# https://stackoverflow.com/questions/41254104/systemd-service-unit-file-as-user
#
# templated
#
[Unit]
Description=MATLAB FlexLM license manager
[Service]
Type=forking
ExecStart=/usr/local/MATLAB/R2017a/etc/lmstart
ExecStop=/usr/local/MATLAB/R2017a/etc/lmdown
KillMode=none
Restart=on-failure
RestartSec=90
# it would be nice to templatize this
User=lmgrd
[Install]
WantedBy=multi-user.target

Donald Wu
Donald Wu on 30 Apr 2018
Thanks Richard,
The service script works on Ubuntu 16.04. I created a symbolic link "Current" to the latest Matlab installation folder, such "R2018a" and use the "Current" folder name in the script so that the script can be same after the new version is installed.

Soporte Técnico MODEMAT
Soporte Técnico MODEMAT on 31 Mar 2020
I made some changes to the Richard's file and it is working for me:
#
# Modificado para la versión de Matlab R2019b
# Creado el 31/03/2020
#
#
#
[Unit]
Description=MATLAB FlexLM license manager
After=network.target
[Service]
User=lmgrd
Type=forking
ExecStart=/usr/local/MATLAB/R2019b/etc/lmstart
ExecStop=/usr/local/MATLAB/R2019b/etc/lmdown
KillMode=none
Restart=on-failure
RestartSec=90
[Install]
WantedBy=multi-user.target

Rob Kudyba
Rob Kudyba on 5 May 2021
I'd like to suggest that where you have:
ExecStart=/usr/local/MATLAB/R2019b/etc/lmstart
Include an option for the path to the license file, use lmgrd and a path to a log file that the user who starts the licensing server has access to so something like:
[Unit]
Description=MATLAB FlexLM license manager
After=network.target
[Service]
User=lmgrd
Type=forking
ExecStart=/usr/local/MATLAB/R2021a/etc/glnxa64/lmgrd -c /path/to/license.dat -l /path/to/logfile
ExecStop=/usr/local/MATLAB/R2021a/etc/glnxa64/lmdown
KillMode=none
Restart=on-failure
RestartSec=90
[Install]
WantedBy=multi-user.target

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!