A systemd service template for MATLAB's FlexLM license manager. Uploading here because it's outrageous that MATLAB doesn't include one of these by default. Hopefully it proves useful for other people too. Confirmed to work on CentOS 7.
Just copy matlablm.service to /usr/lib/systemd/system/. You need to change the User bit to a normal user on the machine in question (i.e. not root). Note that this is for FlexLM installs in /usr/local/MATLAB. If installed in a different location, change the commands for ExecStop and ExecStart to the proper locations.
To start/stop FlexLM:
sudo systemctl start matlablm
sudo systemctl stop matlablm
To start on boot:
sudo systemctl enable matlablm
Jeff Stafford (2021). jstaf/matlablm-systemd (https://github.com/jstaf/matlablm-systemd), GitHub. Retrieved .
It is better to copy the systemd unit file to /etc/systemd/system (where the local configuration files are stored) as opposed to /usr/lib/systemd/system, where units of installed packages reside. Refer to man 5 systemd.unit, "UNIT FILE LOAD PATH".
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!