How to run DR Server and Licensing Server as services


Starting from the release of Corona Renderer 1.4 it is possible to install and run Corona Distributed Rendering Server and Licensing Server as Windows services. You can use the below script package for this:

After the installation, both of the servers will be automatically run as services on system startup.

 

All the scripts for installing and removing services need administrator privileges to work properly. They must be run from an elevated command line or by right clicking and then selecting „Run as administrator“ option in the pop up menu.


The scripts expect that Corona was installed to the default location (C:\Program Files\Corona). If that is not the case, you need to modify the path at the top of each script before it is run, or install DrServer and Licensing Server in their default directories.

 

The .bat scripts can be removed after the installation but as long as the services are installed, the nssm.exe must remain at the same location otherwise the services will stop working.

 

The scripts are registering Corona servers as services using the NSSM tool - http://www.nssm.cc/



Note: network drive mapping is not supported in service mode! The recommended solution is to use UNC paths instead.




Troubleshooting


1. The service does not start correctly, the command line window just stays open saying "Starting Corona Licensing Server service", and you can find the following lines in the system log:

Log Name: Application
Source: nssm
Date: 5/5/2017 11:08:29 AM
Event ID: 1010
Failed to start service Corona Licensing Server.  Program C:\Program Files\Corona\LicensingServer.exe --noGui couldn't be launched. CreateProcess() failed: The system cannot find the file specified.


Solution:

  1. In the "servers-service" folder run "RemoveLicensingServer.bat" - this is just in case, to make sure that everything is uninstalled, and later installed properly
  2. Edit the InstallLicensingServer.bat file
  3. Make sure that the "nssm install "Corona Licensing Server"" line points to the correct location where your licensing server is located - by default it is installed to C:\Program Files\Corona, however it can be placed anywhere, as it does not require installation

Below is an example .bat code, which works if the licensing server is located in C:\Program Files\Corona\ :

@echo off

echo Installing Corona Licensing Server service
nssm install "Corona Licensing Server" "C:\Program Files\Corona\LicensingServer.exe"
echo Starting Corona Licensing Server service
nssm start "Corona Licensing Server"
pause

The "pause" line at the end is to prevent the cmd window shutting down once the operation is completed. Thanks to this, you should see a message "the operation completed successfully".
Remember about using quotes (") in the path to the licensing server. The command will not work otherwise.



2. Where are the logs stored when the licensing server is running as a service?

LicensingServerLog.txt will be stored in C:\Windows\SysWOW64\config\systemprofile\AppData\Local\CoronaRenderer


3. Is there a way I can query the licensing server when it is running as a service?

This is not possible directly, but the application which is used for launching the licensing server as a service (NSSM) supports some commands that may be helpful:

https://nssm.cc/commands


For example running

nssm status "Corona Licensing Server"
should print "SERVICE_RUNNING"