[MacOSX] Setting up RLM to always start automatically


If you want the RLM license server to automatically start everytime you restart or turn on your Mac, you need to create a launch daemon. Don’t worry, it’s not as scary as it sounds 🙂

First, you need create a launchd property list (.plist) for RLM. It will look something like this:

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
        <key>Label</key>
        <string>com.solidangle.rlm</string>
        <key>ProgramArguments</key>
        <array>
        <string>/PATH/TO/RLM/rlm</string>
        <string>-c</string> <string>/PATH/TO/RLM/arnold.lic</string>
        <string>-dlog</string> <string>/PATH/TO/RLM/solidangle.dlog</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
 </dict>
 </plist>

This plist file basically tells the system to start rlm with the -c and -dlog flags, like this:

/Users/stblair/solidangle/RLM/rlm -c /Users/stblair/solidangle/RLM/rlm/arnold.lic -dlog /Users/stblair/solidangle/RLM/rlm/solidangle.dlog

The -c flag isn’t necessary if the license file is in the same folder as the RLM binary executable.

Here’s an example com.solidangle.rlm.plist. Download it, and use TextEdit to change the paths to match the RLM location on your computer, and then save the RLM plist file in /Library/LaunchDaemons/. Note that this download plist assumes that the license file is in the same folder, and therefore omits the -c flag.

For example:

sudo cp com.solidangle.rlm.plist /Library/LaunchDaemons

Note: The plist file needs to be owned by root, otherwise you won’t be able to load the plist. If necessary, you can change the owner like this:
sudo chown root /Library/LaunchDaemon/com.solidangle.rlm.plist

Finally, you need to load the plist:

sudo launchctl load -w /Library/LaunchDaemon/com.solidangle.rlm.plist

The license server will now automatically start, even after a restart or power down of the machine.

You can check the license server by opening a Web browser and going to localhost:5054.

[SItoA] Doing a license check in Softimage


Setting up the environment right is what often goes wrong. Running kick -licensecheck from inside Softimage is a quick way to check that you set up the environment variables correctly.

Here’s two lines of Python that will open a command prompt and run kick -licensecheck (on Windows).

#Python
from subprocess import Popen
Popen(["cmd", "/K", XSIUtils.BuildPath( Application.Plugins('Arnold Render').OriginPath, 'kick.exe' ), "-licensecheck"])

Here’s the same thing, but broken down a bit for legibility:

#Python
si = Application

p = si.Plugins('Arnold Render')
sKick = XSIUtils.BuildPath( p.OriginPath, 'kick.exe' )

from subprocess import Popen
Popen(["cmd", "/K", sKick, "-licensecheck"])

[MtoA] Doing a license check in Maya


If you’re doing technical support like me, you gotta love things like kick -licensecheck. I wish we’d had something like this at Softimage. This license check will tell you:

  • Whether you can connect to a license server
  • What licenses are available
  • What are the licensing environment variable settings

licensecheck

In this example, I’m running Maya and the license server on the same computer. That’s why none of the environment variables are set, but the licensecheck still shows that there’s a license available. By default, Arnold will connect to 5053@localhost to get a license.

The case of the license server that wasn’t releasing licenses


In this case, a customer reported that the license server wasn’t releasing licenses when a render node crashed.

Why did this happen? Because the customer had an older version of the license server that didn’t have a license TIMEOUT.

Since early 2012, the Solid Angle license server ships with a default TIMEOUT of 120 seconds. That means if a workstation stops sending heartbeats to the license server, then after two minutes the license server takes back the license. So, for example, if a workstation crashes or disconnects from the network, then the license server will take back the license after a couple of minutes.

The TIMEOUT is specified in a solidangle.opt file located in the RLM folder, along with rlm.exe and solidangle.set. Newer versions of the Solid Angle license server ship with this options file, but if you don’t have it, you can either upgrade your RLM or create the file yourself. Here’s what it should look like:

TIMEOUT 120 arnold

You’ll need to restart the server to read the new options.

What are heartbeats? Heartbeats are messages sent from a licensed application to the license server while the application has one or more licenses checked out from the server. You can see them with Process Monitor. In this screenshot, you can see that XSI.exe is sending a heartbeat every one minute to the license server.
heartbeats

If you need to free a checked out license, you can “remove” it (that’s RLM-speak for taking back a checked out license).

To remove a license in rlm admin (localhost:5054):

  • Click Status.
    Status
  • Under Server Status, click solidangle.
    ServerStatus
  • Under Show License Usage, click Usage.
    ShowLicenseUsage
  • Click Remove.
    LicenseUsage-Remove

Port 5053 in use, waiting…


If you see the “Port 5053 in use, waiting…” message in your debug log (or on the console), that means there’s already an RLM license server running on that port.

C:\Program Files\RLM>rlm -c test.lic
12/05 11:44 (rlm) RLM License Server Version 9.4BL2

        Copyright (C) 2006-2012, Reprise Software, Inc. All rights reserved.

12/05 11:44 (rlm) License server started on SOLIDANGLE-PC
12/05 11:44 (rlm) Server architecture: x86_w1
12/05 11:44 (rlm) License files:
12/05 11:44 (rlm)     test.lic
12/05 11:44 (rlm)
12/05 11:44 (rlm) Web server starting on port 5054
12/05 11:44 (rlm) Port 5053 in use, waiting...
12/05 11:44 (rlm) Port 5053 in use, waiting...
12/05 11:45 (rlm) Port 5053 in use, waiting...
12/05 11:45 (rlm) Port 5053 in use, waiting...
12/05 11:45 (rlm) Port 5053 in use, waiting...

5053 is the default port for RLM licenses, so if you already have a RLM-licensed product (for example, from the Foundry or from Exocortex), then port 5053 is already in use.

The solution is simple: edit your .lic file and change the port number on the HOST line to something like 5052 or 5060. Do not use port 5054. 5054 is used for the RLM Web Server, and you’ll get a “Cannot bind Web Server port 5054, exiting” error if you try to use it for the license server.

HOST localhost 0000DEADBEEF 5060
ISV solidangle
LICENSE solidangle arnold 400 permanent 1 share=h min_timeout=120
start=30-nov-2012 issuer=sb customer=sb issued=30-nov-2012 replace
_ck=00d68b14f9 sig="c2N2558b3XHN7k+6bEYb0BhzLSCYu6aS0ih75*sy8kZUTCj
Rf76V1ThsffjhJN"

Arnold is licensed per computer


If you run multiple instances of Arnold on a computer, they will all share a single license. Arnold licenses are per-computer, not per-CPU or per-core or per-user.

In the license file, the share= attribute (line 3) controls how the licenses are shared. Arnold uses share=h, which means all processes running on the same host (aka computer) will share the same license.

HOST localhost 0000DEADBEEF 5053
ISV solidangle
LICENSE solidangle arnold 400 permanent 1 share=h min_timeout=120
  start=17-oct-2012 issuer=JB customer=blair issued=17-oct-2012
  replace _ck=00d67b16fa sig="x2M232yijKbUFZ=Mx7MdfzVGiYqz5Vgk6ih1gUt
  vGn1IJyDxwv7FFDrynQwJ3N"