Unlike Gurobi's Compute Server, Gurobi's Token Server cannot be installed as a service. This means you manually have to tell your operating system to launch the token server. There are a few different ways to accomplish this:
The easiest way to achieve this is by creating or extending the file /etc/rc.local, which is executed when the system has booted. This file should look something like this:
In addition, you need to change the permissions of the rc.local file such that it can be executed by running
sudo chmod +x /etc/rc.local
You can also use cron to start the token server process after every reboot. As user root, you need to open the cron configuration using
Then, you can enter the command to start grb_ts after a restart:
To check whether the new cron command has been registered, you can run
systemd can be configured to run the token server as a "simple" service type. To set this up, create a service file at /etc/systemd/system/grb_ts.service with the following contents:
Description=Gurobi Token Server
The important points to note here are that the service type is set to simple, and that grb_ts is run with the -n switch so that it does not fork when started.
To inform systemd of this new service file, start the service, and set it to start automatically when the system boots, run the following:
sudo systemctl daemon-reload
sudo systemctl start grb_ts
sudo systemctl enable grb_ts
The status of the service can then be checked using:
sudo systemctl status grb_ts
Please also note that in this case the token server is run as the root user, so the license file should be installed at the default location /opt/gurobi/gurobi.lic, not in the account of a particular user.
Please sign in to leave a comment.