You are running a license server for your Luciad portfolio products, and you don’t want to have to remember to start the license server each time you launch a Luciad portfolio product. You would like the license server to start without any manual intervention.

If you configure the license server to start when the computer boots, it will always be up-and-running. To start the license server automatically, you have to set it up as a service on your operating system.

How does it work?

Both Windows and Linux both have a notion of services. Services are utility applications that run in the background, and start automatically at boot time. The license server, on the other hand, is a regular program. To configure the license server as a service, you need to wrap it with some helper programs.

How to do it?

Instructions for running the license server as a service are provided for both Windows and Linux.

Run the license server as a service on Windows

On Windows, applications need to be specially created as service applications. The Luciad license server is not such a service application, but a regular console application. There are various tools that can install such applications as Windows services, though. One is the NSSM tool, which can be downloaded from here.

You also need to download licenseserver_install.bat. It uses the NSSM tool to install the license server as a Windows service.

To install the license server as a Windows service:

  1. Copy the license server to a folder on the Windows machine, for instance C:\Luciad\LicenseServer\.

  2. Copy the licenses for the license server to a folder on the Windows machine, for instance C:\Luciad\Licenses\.

  3. Edit the licenseserver_install.bat script, making sure that the paths to the various files are set correctly.

  4. Execute the script.

You can now manage the license server like any Windows service. If necessary, you can uninstall the license server by running the same script with the uninstall parameter:

licenseserver_install.bat uninstall

Run the license server as a service on Linux

On Linux, there are several possibilities to start the license server automatically. First, however, you need to install the license server and its licenses on the Linux machine:

  1. As root, create a user called luciad.

  2. As root, copy the license server to /opt/luciad/licenseserver and make sure it is executable.

  3. As root, copy the licenses to /etc/luciad/licenses.

Once you have installed the license server on the machine, you can configure it to start automatically: use either SysV-style init scripts or systemd for this.

You can change the paths in which you install the server and the licenses. If you decide to do so, you will need to adjust the instructions below accordingly.

Starting the license server with the SysV init script

Currently, the most common way to start a service on Linux is to create an init script. This init script should be placed in the correct location. It starts the service as a daemon process.

Init scripts are highly dependent on the Linux distribution you are using. This init script works on Debian "Wheezy". The script needs the daemon package to start the license server, so you need to install that first. It also runs the license server as the luciad user.

The step-by-step installation instructions are:

  1. Install the license server as described above.

  2. As root, install the daemon package:

    apt-get install daemon
  3. As root, create a user called luciad:

    useradd luciad
  4. Copy the init script to the /etc/init.d folder on your Linux machine.

  5. As root, link the script to the appropriate locations so it starts when the machine starts up.

    update-rc.d luciadlicenseserver defaults

You can still stop and start the license server manually, when you copied new licenses to the /etc/luciad/licenses directory for instance. You can do so with the following commands:

service luciadlicenseserver stop
service luciadlicenseserver start
service luciadlicenseserver status

Starting the license server with the systemd service

Systemd is a startup system that is used by more and more Linux distributions. If your Linux distribution uses systemd, you can use this service definition file to start the license server automatically at system startup. The file also runs the license server as the luciad user.

The step-by-step installation instructions are:

  1. Install the license server as described above.

  2. As root, create the necessary directories, and make sure the luciad user can write to them:

    mkdir -p /var/log/luciad/ && chown luciad.luciad /var/log/luciad
  3. As root, save the service definition file in /etc/systemd/system/luciadlicenseserver.service.

  4. Reboot.

You can still stop and start the license server manually, when you copied new licenses to the /etc/luciad/licenses directory, for instance. You can do so with the following commands:

systemctl stop luciadlicenseserver
systemctl start luciadlicenseserver
systemctl status luciadlicenseserver