3.3.1 Running the rlm server as a Service on Windows

On Microsoft Windows servers, you may want to install and run the rlm server as a Windows service process. A service process can start automatically at boot time and remain running as long as the system is up, regardless of user logins and logouts.

You can install RLM as a service in a command window. Once installed as a service, it remains installed until it is explicitly deleted as a service. Installing RLM as a service does not start RLM; services are started via the Windows Services control panel, and at boot time.

You can only install RLM as a service in a command window. To do this, use the rlm program itself (in a command window), with special arguments:

rlm -install_service -dlog [+]logfile [-service_name sname] [-user username] [-password
password] <rlm runtime args>

where:

  • logfile is the pathname for the server debug log. This parameter is required. If preceded by the '+' character, the logfile will be appended, rather than created.
  • sname is an optional name for the installed service. If not specified, sname defaults to "rlm". If sname contains embedded whitespace, it must be enclosed in double quotes.
  • <rlm runtime args> are any other command line arguments to be passed to rlm when it is started.

Example:

rlm -install_service -service_name rlm-xyz -dlog c:\logs\server.log -c c:\licenses\xyz.lic

This installs rlm as a service under the name "rlm-xyz". When started via the Services control panel or at boot time, rlm will be passed the "-c c:\licenses\xyz.lic" args, and it will write it's debuglog information to the file c:\logs\server.log.

Installed RLM services are also deleted with the rlm program. Services must be stopped via the service control panel before they can be deleted. Note that deleting a service deletes it from the Windows service database; it does not delete the rlm executable or associated license file(s):

rlm -delete_service [-service_name sname]

where:

  • sname is an optional name for the installed service. If not specified, service_name defaults to "rlm". If service_name contains embedded whitespace, it must be enclosed in double quotes.

Notes:

  • It is desirable to use the -c <license file> command line argument with RLM when installed as a service. Use of environment variables with Windows services is undesirable, as the environment passed to started services is the one in effect at boot time.
  • On systems which run RLM license servers, it is a good idea to install each ISV's instance of rlm with a service_name argument which reflects the ISV or ISVs whose licenses are being served by that instance of rlm. For example, if a system ran two instances of RLM as services, where the first instance served license for ISVs "Blue" and "Green," and the second instance served license for ISV "Yellow", they might be installed as "rlm Blue-Green" and "rlm Yellow," respectively.
  • Because the Service Controller on Windows invokes services under a special user account in a special default directory, it is necessary to use full paths:
    • for the -c <license file> argument on the rlm command line
    • in ISV daemon paths in the license file
    • in options file paths in the license file
    • in debug log paths in the ISV options file
    • in report log paths in the ISV options file
    • for the -dlog debug_log argument on the command line
  • NOTE on the use of DEBUGLOG when running the server as a Windows Service: If no DEBUGLOG is specified in the ISV options file, rlm will write the ISV debug log in:

    <location of rlm.exe>\<isv>.dlog

    This file will be overwritten every time the ISV server starts, since there is no opportunity to specify that the file should be appended to in the default case. In fact, the ISV server logs a few lines to this file at startup time even if a DEBUGLOG is specified in the ISV options file. It is overwritten every time the ISV server starts, but its contents don't change startup to startup, so nothing important is lost.

    Reprise Software Inc. recommends that the debug log path be specified in the ISV options file, and that the append behavior be enabled with '+'<path>. However, it is important not to specify the debug log name as <isv>.dlog, as this specific file is overwritten at each startup.

Additional Notes also extracted from the RLM License Administrator manual:

  • When running as service, rlm now changes its working directory to the directory where rlm.exe is installed. This is so that log files will be written there instead of in c:\windows\system32 as in prior versions (if log file paths are not specified as absolute paths.) rlm.exe checks to make sure that it can write to that directory before changing its working directory. If it can't be written, rlm leaves its working directory as c:\windows\system32.
  • The ISV servers place their debug output in the same file as the rlm server's debug log, as specified in the -dlog option, so no DEBUGLOG specification is necessary.
  • When you install RLM as a service, it starts and then stops the installed service. This is so that if there are any firewall issues - ports blocked that rlm needs to use - the warnings come at service installation time rather than when rlm is started for the first time.
  • RLM checks the path you specify for the debug log (-dlog or in the "Server Debug Log box in the web interface). If this file cannot be written, an error is printed and the service install fails.