Floating License Server

ReqView Floating License Server is a web service providing floating licenses for ReqView products. It communicates with client applications using secure HTTPS connections, so it must be started with a TLS/SSL certificate (and its private key).

ReqView Floating License Server comes with a set of certificates so that it can be easily started out of the box. However, if you wish to use existing certificates or generate your own, please see TLS/SSL Certificates for details.

The license server must run at the exact address and port for which the ReqView floating licenses were generated.

Command Line Interface

Basic Usage and Arguments:

reqview_license_server [-h] [--host HOST [HOST ...]]
                       --port PORT
                       --certfile CERTFILE
                       [--adminpwfile ADMINPWFILE]
                       [--license LICENSE [LICENSE ...]]
Option Necessity Description
-h, --help Show help message and exit
--host optional Host(s) to bind to; defaults to 0.0.0.0 (all interfaces)
--port required Port to serve on
--certfile required File in PEM format containing the server TLS/SSL certificate
--adminpwfile optional File containing the password that protects the admin site (username is always admin), the password will be set to admin if not provided (v1.1.0+) New
--license optional ReqView floating server license file(s) to serve; the licenses will be stored until expiration

Example:

Start the ReqView Floating License Server on port 8000 with a TLS/SSL certificate stored in file server.pem:

$ reqview_license_server --port 8000 --certfile server.pem --license reqview_server_license.key

Running as Windows Service

You can run the ReqView Floating License Server as a Windows service using NSSM (the Non-S***ing Service Manager).

Windows Service Configuration:

  1. Run an Administrator command prompt and change directory to a folder that will permanently contain the reqview_license_server.exe binary.
  2. Install and configure the service using the following commands by editing the service.cmd file:
    nssm install reqview-license-server reqview_license_server.exe
    nssm set reqview-license-server AppParameters --port 8000 --certfile "%cd%\server.pem" --cafile "%cd%\ca.pem" --adminpwfile "%cd%\adminpw.txt" --license "%cd%\my_floating_server_license.key"
    nssm set reqview-license-server AppDirectory "%cd%"
    nssm set reqview-license-server DisplayName "ReqView License Server"
    nssm set reqview-license-server Description "Provides floating licenses to ReqView clients."
    nssm set reqview-license-server DependOnService Tcpip
    nssm set reqview-license-server ObjectName NetworkService
    nssm set reqview-license-server Start SERVICE_DELAYED_AUTO_START
    nssm set reqview-license-server AppStopMethodSkip 2
    nssm set reqview-license-server AppNoConsole 1
    nssm set reqview-license-server AppStdout "%cd%\stdout.log"
    nssm set reqview-license-server AppStderr "%cd%\stderr.log"

    Batchfile

The arguments present in the second command will be used when the server is started or restarted. Do not move or delete the directory or any files in it after the service is installed. The file nssm.exe must also be kept as it is the executable registered for the service.

Note that absolute paths must be used (the current directory is prefixed by %cd% in the example above), and quoted if they contain spaces. Standard output and error streams are appended to the files given by AppStdout resp. AppStderr variables.

As the service is started under the NetworkService account (a predefined account with minimum privileges), you must ensure that this account has read, write and execute permissions for the directory containing the reqview_license_server.exe binary. Alternatively, you can make the service run under LocalSystem account (which has extensive privileges) by removing the line nssm set reqview-license-server ObjectName NetworkService from the service.cmd file. See more information about service user accounts.

You can also review or edit the service configuration using the NSSM GUI by running nssm edit reqview-license-server command.

Windows Service Management:

The service will be started automatically on system boot. Afterwards, you can manage the service (start, restart, stop or query its status) using the following commands:

nssm start reqview-license-server
nssm restart reqview-license-server
nssm stop reqview-license-server
nssm status reqview-license-server

If necessary, you can stop the service and then uninstall it by nssm remove reqview-license-server confirm command.

Running as Docker Service

Assuming you already have Docker and Docker Compose all set up, run a console with sufficient privileges and change directory to the location of reqview_license_server binary, certificate and license files needed by it.

Docker Service Configuration:

The service configuration is defined in the docker-compose.yml file, you can change it based on your needs if necessary. Start the service by:

$ docker-compose up -d

Docker Service Management:

$ docker-compose start reqview-license-server
$ docker-compose restart reqview-license-server
$ docker-compose stop reqview-license-server
$ docker-compose logs reqview-license-server

Don’t forget to restart the service when you update the reqview_license_server binary or the license file.

If necessary, you can stop the service and then uninstall it by docker-compose rm reqview-license-server command.

Administration Web Page

You can check the Floating License Server status using the administration web page located at address https://<license-server-url>/admin:

FloatingLicenseServer.png

Note that the <license-server-url> address must be the full address and match the address present in the server certificate exactly.

The administration web page is protected by a login form where the only correct username is admin and the password is taken from the file supplied by the --adminpwfile argument. The password will be set to admin if the password file is not provided.

The Licenses page shows the served licenses and current checkouts/borrows by ReqView users. If a ReqView user cannot check in the floating license (in exceptional circumstances), the license administrator can manually cancel the checkout/borrow using the Cancel button.

The Log page shows all server events that occurred during the last two weeks with the most recent event listed at the top.

You can refresh the website using the F5 shortcut to get the latest information.

Querying License Server Status

You can query the server status in console using curl tool on the https://<license-server-url>/status URL:

$ curl -k https://reqviewlicense.intranet.mycompany.com:8000/status

Which will produce the following output in JSON format:

{
"my-reqview-floating-license": {
"issued": 10,
"in_use": 3
}
}

JSON

You can easily implement a script processing the JSON output and run it periodically. For example, the following Python script status.py outputs a message stating the currently available number of licenses:

import sys
import json
 
try:
data = json.load(sys.stdin)
except Exception:
data = {}
issued = 0
in_use = 0
for lic in data.values():
issued += lic['issued']
in_use += lic['in_use']
print("Total %d issued, %d in use" % (issued, in_use))

Python

You can run the status.py script and curl command in a pipe:

$ curl -s -k https://reqviewlicense.intranet.mycompany.com:8000/status | python status.py

Which will print:

Total 10 issued, 3 in use
Updated for version 1.1.0