7.2 Linux, macOS: Token server setup

Below is a step-by-step guide to starting the token server on Linux and macOS. The same instructions can also be applied to start the token server on Windows from the command line, although for most Windows users the approach from Sec. 7.1 (Windows: Token server setup), which installs the token server as a service, is preferable.

7.2.1 Prerequisites and locating the files

  • Make sure you have appropriate administrative privileges if needed.

  • Locate the bin folder of your MOSEK installation, that is

    <MSKHOME>/mosek/11.1/tools/platform/<PLATFORM>/bin/

    where <PLATFORM> is the platform you are working on. That folder contains the files lmgrd and MOSEKLM required by the license system.

  • Download the license file and store it on the local drive.

  • Decide if you want to choose your own port numbers for the service instead of using defaults. If yes, edit the license file as in Sec. 7 (Floating license setup).

7.2.2 Starting the token server

To start the token server open the terminal, go to the bin folder of the MOSEK installation mentioned above and run:

./lmgrd -c PATH_TO_LICENSE -l lmgrd.log

where PATH_TO_LICENSE is the path to your license file. The token server will save a log file in the location given by the -l command line parameter.

7.2.3 Checking that startup succeeded

If the token server was started successfully the lmgrd.log file will look similar to this

9:49:15 (lmgrd) -----------------------------------------------
9:49:15 (lmgrd)   Please Note:
9:49:15 (lmgrd) 
9:49:15 (lmgrd)   This log is intended for debug purposes only.

.....

9:49:15 (lmgrd) 
9:49:15 (lmgrd) -----------------------------------------------
9:49:15 (lmgrd) 
9:49:15 (lmgrd) 
9:49:15 (lmgrd) Server's System Date and Time: Mon Feb 28 2022 09:49:15 CET
9:49:15 (lmgrd) SLOG: Summary LOG statistics is enabled.
9:49:15 (lmgrd) FlexNet Licensing (v11.18.3.0 build 283040 x64_lsb) started on hostname (linux) (2/28/2022)
9:49:15 (lmgrd) Copyright (c) 1988-2021 Flexera. All Rights Reserved.
9:49:15 (lmgrd) World Wide Web:  http://www.flexerasoftware.com
9:49:15 (lmgrd) License file(s): /home/username/mosek/mosek-floating.lic
9:49:15 (lmgrd) lmgrd tcp-port 27007
9:49:15 (lmgrd) (@lmgrd-SLOG@) ===============================================
9:49:15 (lmgrd) (@lmgrd-SLOG@) === LMGRD ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Start-Date: Mon Feb 28 2022 09:49:15 CET
9:49:15 (lmgrd) (@lmgrd-SLOG@) PID: 2147425
9:49:15 (lmgrd) (@lmgrd-SLOG@) LMGRD Version: v11.18.3.0 build 283040 x64_lsb ( build 283040 (ipv6))
9:49:15 (lmgrd) (@lmgrd-SLOG@) 
9:49:15 (lmgrd) (@lmgrd-SLOG@) === Network Info ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Listening port: 27007
9:49:15 (lmgrd) (@lmgrd-SLOG@) 
9:49:15 (lmgrd) (@lmgrd-SLOG@) === Startup Info ===
9:49:15 (lmgrd) (@lmgrd-SLOG@) Server Configuration: Single Server
9:49:15 (lmgrd) (@lmgrd-SLOG@) Command-line options used at LS startup: -c /home/username/mosek/mosek-floating.lic 
9:49:15 (lmgrd) (@lmgrd-SLOG@) License file(s) used:  /home/username/mosek/mosek-floating.lic
9:49:15 (lmgrd) (@lmgrd-SLOG@) ===============================================
9:49:15 (lmgrd) Starting vendor daemons ... 
9:49:15 (lmgrd) Started MOSEKLM (internet tcp_port 36867 pid 2147427)
9:49:15 (MOSEKLM) FlexNet Licensing version v11.18.3.0 build 283040 x64_lsb
9:49:15 (MOSEKLM) SLOG: Summary LOG statistics is enabled.
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT1
9:49:15 (MOSEKLM) SLOG: VM Status: 0
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT5
9:49:15 (MOSEKLM) SLOG: TPM Status: 0
9:49:15 (MOSEKLM) SLOG: FNPLS-INTERNAL-CKPT6
9:49:15 (MOSEKLM) Server started on hostname for:	PTS		
9:49:15 (MOSEKLM) PTON		
9:49:15 (MOSEKLM) EXTERNAL FILTERS are OFF
9:49:15 (lmgrd) MOSEKLM using TCP-port 36867
9:49:15 (MOSEKLM) SLOG: Statistics Log Frequency is 240 minute(s).
9:49:15 (MOSEKLM) SLOG: TS update poll interval is 600 seconds.
9:49:15 (MOSEKLM) SLOG: Activation borrow reclaim percentage is 0.
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) ===============================================
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Vendor Daemon ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Vendor daemon: MOSEKLM
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Start-Date: Mon Feb 28 2022 09:49:15 CET
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) PID: 2147427
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) VD Version: v11.18.3.0 build 283040 x64_lsb ( build 283040 (ipv6))
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Startup/Restart Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Options file used: None
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is vendor daemon a CVD: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is FlexNet Licensing Service installed and compatible: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) FlexNet Licensing Service Version: -NA-
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Is TS accessed: No
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) TS access time: -NA-
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Number of VD restarts since LS startup: 0
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Network Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Listening port: 36867
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Daemon select timeout (in seconds): 1
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) === Host Info ===
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Host used in license file: hostname
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) HostID node-locked in license file: b47acd81a33c 
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) HostID of the License Server: "b47acd81a33c b47acd81a33d"
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) Running on Hypervisor: Not determined - treat as Physical
9:49:15 (MOSEKLM) (@MOSEKLM-SLOG@) ===============================================
9:49:15 (MOSEKLM) TCP_NODELAY NOT enabled
9:49:15 (MOSEKLM) Listener Thread: running
9:49:15 (MOSEKLM) Starting diagnostics port listener thread (DPLT)
9:49:15 (MOSEKLM) Starting diagnostics output thread (DRQT)

In particular, the major information contained in the file is:

  • the port lmgrd is running on (in this case 27007, the default port used by MOSEK),

  • the port MOSEKLM is running on (in this case 36867, by default a value assigned dynamically at startup),

  • the path to the license file that was used,

  • the hostname and hostid of the machine,

  • the licensed part IDs (in this case PTS and PTON)

If the log file indicates errors consult Sec. 11.2 (Floating license issues).

7.2.4 Testing the Token Server

In order to verify that the token server is running, go to the bin folder of the MOSEK installation mentioned above and run:

./lmutil lmstat -c 27007@127.0.0.1 -a

(if necessary replace 27007 with your port number). The result for a successfully running token server should be similar to the one below:

lmutil - Copyright (c) 1989-2021 Flexera. All Rights Reserved.
Flexible License Manager status on Mon 2/28/2022 10:09

License server status: 27007@hostname
    License file(s) on hostname: /home/username/mosek/mosek-floating.lic:

    hostname: license server UP (MASTER) v11.18.3

Vendor daemon status (on hostname):

   MOSEKLM: UP v11.18.3
Feature usage info:

Users of PTS:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of PTON:  (Total of 5 licenses issued;  Total of 0 licenses in use)

7.2.5 Troubleshooting

If the server won’t start, or the client can’t check out the license first check Sec. 11.2 (Floating license issues). It covers most typical issues. Always consult the log file lmrgd.log of the server.

If that doesn’t help please contact MOSEK support at support@mosek.com. Please include the client error messages and the server log file lmgrd.log. See Sec. 11.4 (Need more help).

If on Linux you get an error similar to:

./lmgrd: No such file or directory

then most likely you are using an older version of the token server which required the Linux Standard Base lsb package. Either install the package or use the token server from the most recent MOSEK distribution (at least 10.2).

7.2.6 Starting lmgrd on boot

To start the license server automatically on boot add the above procedure to your system’s startup scripts. Details vary depending on the operating system. Here is an example of a systemd service unit for use with systemctl on Ubuntu:

[Unit]
Description=MOSEK floating license server
After=network.target

[Service]
User=someuser
Environment=MOSEKLM_LIC_FILE=/home/someuser/mosek/mosek.lic
Environment=MOSEKLM_LOG_FILE=/home/someuser/mosek/lmgrd.log
ExecStart=/home/someuser/mosek/10.0/tools/platform/linux64x86/bin/lmgrd -c ${MOSEKLM_LIC_FILE} -l ${MOSEKLM_LOG_FILE}
ExecStop=/home/someuser/mosek/10.0/tools/platform/linux64x86/bin/lmutil lmdown -c ${MOSEKLM_LIC_FILE}
ExecReload=/home/someuser/mosek/10.0/tools/platform/linux64x86/bin/lmutil lmreread -c ${MOSEKLM_LIC_FILE}
Type=forking

Replace the username and paths with your configuration. It is not recommended to run lmgrd as root.

7.2.7 Administration of the token server

We briefly describe how to stop, disable, restart the token server, update the license file and upgrade the server. A full administrator’s manual with all options and details can be found in License Administration Guide.

All operations related to stopping/restarting/updating/upgrading can be carried out by stopping the lmgrd process and starting a new one.

To stop the token server gracefully, run

./lmutil lmdown -c PATH_TO_LICENSE_FILE

The program lmutil can be found in the bin folder inside the MOSEK installation, that is:

<MSKHOME>/mosek/11.1/tools/platform/<PLATFORM>/bin/

where <PLATFORM> is the platform you are working on.

Now you can start a new license server, if required, with the desired license file and configuration, from the same or another MOSEK installation, according to the instructions in Sec. 7.2 (Linux, macOS: Token server setup).