3.3.1 Running the RLM Server as a Service on Windows Systems
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 snamecontains 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:
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 from 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.
- Beginning in RLM v8.0, 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 web interface service installation is new in RLM v7.0.
- Prior to RLM v4.0 when running rlm as a service, it is strongly recommended that you specify a debug log location for each ISV server. This is done in The ISV Options File for each ISV server, using the DEBUGLOG keyword. If no location is specified for the debug log, the ISV server's debug information is lost when running as a service. Starting in RLM v4.0, 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.
- Starting in v9.4, 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.
- Starting in v10.0, RLM checks the path you specify for the debug log (-dlog <log> 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.
Examples:
rlm -install_service -dlog c:\logs\server.log
The most basic installation. This will install the service under the default service name “RLM” with the logfile server.log under C:\logs\.
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 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 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
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 from 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.
- When running as service RLM changes its working directory to the directory where rlm.exe is installed, so log files will be written there 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:windowssystem32.
- 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.
- Starting in v10.0, RLM checks the path you specify for the debug log (-dlog <log> 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.
