Skip to content

Running the License Server as a service🔗

When run as a system service, the server can be started automatically after the OS has started, requiring less manual control of the server.

Configuring Windows system service🔗

The Windows version of the License Server executable provides two additional commands to register it as a system service. When running as a Windows service, the License Server will write lifecycle (starting, stopping, …) events and events regarding the server license to the Windows Event Log.
All other information will be logged to STDOUT by default, which will be discarded by Windows. To avoid this, you can configure the License Server to write its log messages to a file. See the [example configuration file][configuration-files] on how to set up logging to file.

mlips service create

This command registers the License Server executable as a system service. The command accepts the following command line flags:

--startup=automatic, --startup=manual: Defines whether the service should be started automatically after booting or not

--working-dir: Defines the working directory for the service. Any relative paths in the configuration file will be resolved relative to this path.

Additionally, the License Server command that the service should invoke and any command line options for the License Server serve commands can be provided after a --.

Example of registering an installed License Server using a config file in a different directory

cd %LOCALAPPDATA%\Programs\MVTec\License-Server
mlips service create --startup=automatic -- serve all --config=C:\License-Server\config.yml

When the command runs successfully, it prints the service configuration before exiting.

mlips service remove
This command removes a License Server system service if one is registered.

Configuring Linux systemd service🔗

The Linux version of the License Server generates a systemd file mvtec-license-server.service when it is installed by the MVTec Software Manager.
To start the License Server as a systemd service, verify the contents of this file and then copy it to /etc/systemd/system. Afterward, the service can be enabled and started with the commands

systemctl daemon-reload
systemctl enable mvtec-license-server.service
systemctl start mvtec-license-server.service

Important

Copying the .service file, as well as enabling or starting the service requires elevated rights.

If you want to access the License Server log, you can either log to a file, or configure log messages to be printed to STDOUT. In the latter case, they will be captured by systemd. The captured log messages can be viewed with the following command:

journalctl -u mvtec-license-server.service