Chapter 6. SoftWindows licensing

Licensing SoftWindows

This chapter gives additional information about the FLEXlm licensing system and explains how to use the SoftWindows License Manager to modify a license. SoftWindows is supplied with FLEXlm version 4.1, running lmgrd version 5.0B.

This chapter covers the following topics:

The FLEXlm licensing system

SoftWindows uses a licensing system called FLEXlm nodelock, which lets you administer the licenses for all users on a network from a single workstation. This workstation is known as the license server. The FLEXlm nodelock system is widely used by a number of different software manufacturers, and one license server is sufficient to control any number of software products on the network.

The license server runs a licensing daemon, lmgrd, which invokes a specific daemon for SoftWindows, called insignia. The licensing daemon accesses a license data file, license.dat, which contains information about the license server and the licensed products. By default, this file is located in the directory, $SWINHOME/FLEXlm, where $SWINHOME is the SoftWindows installation directory.

A typical license.dat file looks like the following example:

SERVER sylph 690c1e3a 744
DAEMON insignia /usr/lib/SoftWindows/FLEXlm
FEATURE Insignia_SoftWindows95 insignia 1.0  01-jan-00 0 2C81B6AC6D7364E8A70B VENDOR_STRING="5000 1234 5678 0000" HOSTID=690c1e3a ISSUER="Silicon Graphics, Inc."

The SERVER line specifies the location of the server.

The DAEMON line specifies the pathname of the insignia licensing daemon.

The FEATURE line specifies the licensing information for SoftWindows. Note that this is one line that may wrap onto two lines when displayed, as shown in the example.

The SERVER and DAEMON lines are added to the license.dat file by the License Manager dialog box and may be modified later by the administrator.

The license.dat file is generated by the License Manager dialog box, which is displayed automatically when SoftWindows is run as root with no license server running. It can also be displayed by choosing Licensing from the Actions menu when SoftWindows is run as root.

If you are installing a demo license, no license server is needed. If you are already using FLEXlm, you should install the demo license on your existing license server.

The TCP port number

FLEXlm runs over TCP and uses the socket assigned in the license.dat file on the server. For example, in the line:

SERVER waltz 35648797 744 

744 is the TCP port number which the software has assigned to FLEXlm. This number can be changed but 744 is the default.

The TCP number is important, because if the system in the above example is a license server, FLEXlm uses this number to locate the server for users on other systems. To do this, each user must set the LM_LICENSE_FILE environment variable, which takes the form port @ server. Thus, to use the above license server, LM_LICENSE_FILE should be defined as follows for a C shell:

setenv LM_LICENSE_FILE [email protected] 

or for a Bourne or Korn shell:

[email protected]; export LM_LICENSE_FILE 

Alternatively, the variable LM_LICENSE_FILE can be set to reference the license file on the license server. For example, if you have a license server called licserv, and it contains a license file in a FLEXlm directory, which is NFS mounted under /servers/licserv, then LM_LICENSE_FILE could be set to /servers/licserv/FLEXlm/license.dat.

In this case, SoftWindows reads the SERVER line in the license file for the name of the license server to which the TCP port should be connected.

Using FLEXlm

The procedures for starting and stopping FLEXlm must be carried out as root.

There are two ways to start FLEXlm using the lmgrd utility, in addition to using the user interface.

To start FLEXlm manually

The disadvantage of starting FLEXlm manually is that FLEXlm will need to be restarted if the machine is rebooted.

Enter the command for the Bourne shell:

$SWINHOME/FLEXlm/lmgrd -c $SWINHOME/FLEXlm/license.dat > $SWINHOME/FLEXlm/lmgrd.log 2>&1 & 


Note: This command should be typed on a single line.


To start FLEXlm automatically

You can set up the license system so that it starts during the boot sequence of the license server as follows:

  1. Add the following line to the /etc/inittab file:

    isl:234:respawn:$SWINHOME/FLEXlm/lmgrd -c $SWINHOME/FLEXlm/license.dat > $SWINHOME/FLEXlm/lmgrd.log 2>&1 
    

    where $SWINHOME is the SoftWindows installation directory; for example, /usr/lib/SoftWindows.


    Note: This command should be typed on a single line.


  2. After adding the above line to the relevant system file, type the following command to start FLEXlm:

    /etc/init q 
    

This causes the system to reread the /etc/inittab file.

To shut down FLEXlm

The FLEXlm licensing system should be shut down before deinstalling SoftWindows, if it has been modified in any way from the default SoftWindows installation.

  • If FLEXlm was started manually, type the following command:

    $SWINHOME/FLEXlm/lmdown 
    

    or, if LM_LICENSE_FILE is not set, enter:

    $SWINHOME/FLEXlm/lmdown -c $SWINHOME/FLEXlm/license.dat 
    

  • If the system was started automatically and you want to remove FLEXlm, delete the line that was added to the /etc/inittab or /etc/rc.local file, and enter the following command at the UNIX prompt:

    /etc/init q 
    

    This causes the system to reread the /etc/inittab file.

To set up multiple license servers

At startup, SoftWindows contacts the license server to obtain a valid license. You can set up multiple license servers, so if there are no licenses available on the preferred server, SoftWindows will automatically ask for a license from the next named server.

To set up multiple license servers, define the LM_LICENSE_FILE environment variable at the UNIX prompt as follows:

To run lmgrd as non-root

GLOBEtrotter recommend that lmgrd is run by a non-privileged user to avoid a vulnerability in security.

The way in which SoftWindows is installed should avoid the need to do this. Because running as another user requires knowledge of the customer's user-id allocation, license daemons installed via the SoftWindows user interface are therefore still run as root. However, if you prefer to avoid running lmgrd as root, follow this procedure.


Note: Other applications on your systems (including earlier versions of Insignia software) may also be using FLEXlm.


  1. Create a non-privileged account for use by FLEXlm. For example:

    flexlm:*:2000:250:FLEXlm License Manager:/nonexistent:/bin/sh 
    

    The account must have the following properties:

    • Password set to `*', as interactive access is not required.

    • A unique userid (2000 in the example above).

    • A unique groupid (250 in the example above).

    • A shell of /bin/sh.

  2. Locate the license file. For SoftWindows the default is $SWINHOME/FLEXlm/license.dat.

    The license management daemons must use a non-privileged TCP port (that is, greater than 1024) for communication. The port number chosen may be arbitrary, but the port must not clash with that used by other applications.

    The port is specified in the license data file, in the fourth field along the SERVER line. For example:

    SERVER xyzzy 123456789 6744 
    

    In the above example the port number is 6744.

    If you use the environment variable LM_LICENSE_FILE, this should be changed, for example, to [email protected].

  3. Locate where the FLEXlm license management daemon is started.

    For SoftWindows 95 this is in /etc/inittab.

  4. Find the command line containing `lmgrd'.

  5. Modify this command to look like this:

    su flexlm -c “umask 022; {original command}” 
    

    assuming that you created the user flexlm in the first step above.


    Note: The logging information that is written to stdout from the daemon should not be written to files in /tmp or other world writable directories, but to a specially created directory to which the flexlm user can write log information.


  6. Make sure that the only files on the system that are owned or writable by the flexlm user are the log files. All license and FLEXlm executable files must be readable or executable by the flexlm user.

Additional daemons required by the FLEXlm license management daemon are specified in the license data files. For SoftWindows this is the `insignia' daemon (by default located in $SWINHOME/FLEXlm).

Modifying SoftWindows licenses

SoftWindows includes a Licensing function that allows you to view the licensing information for your SoftWindows installation and, if necessary, update it if you want to extend the license period or add more users.

To display the License Manager

  1. Log in as root.

  2. Run the appropriate window manager (VUE, OpenWindows, CDE, or Motif).

  3. Run SoftWindows.

    An additional Licensing option will then be available on the Actions menu.

  4. Choose Licensing from the Actions menu.

    This dialog box displays the licensing information for your SoftWindows installation:

To install a new license

  1. Choose the type of license by selecting Demonstration, Concurrent, or nodelock as appropriate.

  2. Enter the Serial Number, Expiry Date, Authorization Code, and the Number Of Users in the appropriate text boxes.


    Note: If Demonstration has been selected as the license type, the Number Of Users field is disabled. Alternatively, if the license type Concurrent is selected, the Expiry Date is automatically set to 1/1/0 and should not be changed.


  3. Choose Install License to install the new license.

To run SoftWindows on a network that is currently using FLEXlm

  1. Copy the relevant details from the file $SWINHOME/FLEXlm/license.dat into your own license.dat file, and remove the original file. Insignia can supply authorization codes for multiple redundant servers so that large networks are not totally reliant on one machine.

    This level of complexity is not supported by the SoftWindows license manager dialog box, so the files must be edited manually.

  2. Set up the LM_LICENSE_FILE environment variable for each user, to specify the location of the existing license file.

    • For a C shell user, add one of the following lines to the .login file:

      setenv LM_LICENSE_FILE [email protected] 
      setenv LM_LICENSE_FILE /net/machine/$SWINHOME/FLEXlm/license.dat 
      

      In the first case, enter the appropriate TCP port number and machine name. In the second case, enter an appropriate path through an NFS mount to the license file on the license server.

    • For a Bourne shell user, add one of the following lines to the .profile file:

      [email protected]; export LM_LICENSE_FILE 
      LM_LICENSE_FILE=/net/machine/$SWINHOME/FLEXlm/license.dat; export LM_LICENSE_FILE 
      

      In these examples $SWINHOME is the SoftWindows installation directory.

To change the TCP port used for licensing

The TCP port used for licensing can be changed to avoid a clash with another TCP service on the standard port. You should only do this if you are experienced in using the UNIX system.

  1. Log in as root.

  2. Run the appropriate window manager (VUE, OpenWindows, IBM CDE, or Motif).

  3. Run SoftWindows

  4. Choose Licensing from the Actions menu to display the license manager dialog box.

  5. Choose Advanced to display the TCP Port section of the dialog box:

  6. Enter a new TCP port number.


Note: If you enter an invalid port number, SoftWindows will not work.


Licensing SoftWindows with other products using FLEXlm

If other products on your network use FLEXlm licensing, a conflict may occur with the SoftWindows licensing system.

This section discusses how to avoid this problem.

Products using the same license server

In this case, there are two solutions:

  • The end-user can keep both license files separate, running two copies of lmgrd, one for each license file.

    There is no drawback in this approach, since each lmgrd requires few system resources and takes almost no CPU time.

  • You can combine license files by retaining the set of SERVER lines from any one license file and adding all the other lines (DAEMON, FEATURE, INCREMENT, UPGRADE, and FEATURESET lines) from all the license files. The combined license file can be located in the default location, /usr/local/flexlm/licenses/license.dat, or in any convenient location (which must be set in the LM_LICENSE_FILE environment variable). Alternatively, multiple copies of the file can be located at fixed locations as required by each software vendor.

You must create a symbolic link between the location of the license file and the location where each software package expects to find its license file.


Note: Experienced system administrators often prefer to combine license files; otherwise you are advised to keep these files separate.


Products using different license servers

In this case, separate license files will be required, one for each distinct set of license servers. Where multiple software vendors use the same set of license server nodes, the technique described in the previous section can be used to combine their license files. The resulting (multiple) license files can then be installed in convenient locations, and the user's LM_LICENSE_FILE environment variable should be set as follows.

setenv LM_LICENSE_FILE 1fpath1:1fpath2:....:1fpathN

where 1fpath1 is the path to the first file, 1fpath2 is the path to the second license file, and so on.

When products from different vendors use different versions of FLEXlm, always use the latest versions of the lmgrd and the lmutil utilities. If any products use a version of FLEXlm before v2.0, then the -b startup argument must be used for lmgrd.

The latest version of lmgrd will always support any FLEXlm license. The end-user must verify which lmgrd is the latest version. This can be done using lmgrd -v to get the version information. If you are using a version of lmgrd earlier than the version the vendor is using, error messages may appear such as:

Vendor daemon cannot talk to lmgrd (invalid returned data from license server).

FLEXlm version compatibility

When an end-user has licensed products that incorporate various versions of FLEXlm, care must be taken to insure that the correct versions of lmgrd and the FLEXlm utilities are used.

If the utility programs are FLEXlm v2.4 or later, the latest utility programs should be used. If the utility programs are older than v2.4, the oldest (lowest version number) utility programs should be used. This is because the newest lmgrd knows how to support all versions of the vendor daemons, whereas utilities prior to FLEXlm v2.4 do not know how to communicate with the older vendor daemons. After FLEXlm v2.4, the utility programs automatically back off their communications version to enable them to work with all versions of the FLEXlm daemons.

To determine the version of any FLEXlm-based product, use the following command as root:

strings program_name | grep Highland | grep -i flex 

or

strings program_name | grep Globetrotter | grep -i flex 

Once you have determined the versions of all software you want to use, perform the following procedure:

  • Use the highest numbered lmgrd that you have.

  • Use the FLEXlm utilities that correspond to the oldest client or vendor daemon that you have in use or use the newest utilities if they are FLEXlm v2.4 or newer.

If you have vendor daemons with different FLEXlm versions:

  • If all vendor daemons are later than v2.0, use the latest lmgrd with no options.

  • If you have all FLEXlm v1.x and v2.1 and the newer vendor daemons, use the latest lmgrd with the -b option.

  • FLEXlm v1.x and v2.0 daemons cannot be combined. If you have a combination that includes FLEXlm v1.x and v2.0 daemons, keep them in separate files. Group them so that they follow the two guidelines above. Note that few vendors use v2.0 daemons.

License administration tools

This section describes the license administration tools supplied with FLEXlm. The commands for the tools are contained in a single utility, lmutil, and can be run by typing one of the following commands:

lmutil commandname 
commandname 

All the utilities take the following arguments:

Argument

Description

-v

Print version and exit

-c license_file

Operate on license_file



Note: The lmdown, lmremove, and lmreread commands are limited to privileged users. If you have started lmgrd with the -p switch, you must be a license administrator to run any of these three utilities. A license administrator is a member of the UNIX lmadmin group or a member of group 0, if the lmadmin group does not exist.

The file lmgrd.log contains a log of all FLEXlm activities, and provides useful information for debugging FLEXlm.

lmcksum

Performs a checksum of a license file, and prints a line-by-line checksum for the file as well as an overall file checksum. This can be used to verify that a license has been entered correctly.

By default, lmcksum operates on license.dat in the current directory and may be invoked with an optional daemon name. If this is specified, only license file lines for the selected daemon are used to compute the checksums.

lmdown

Shuts down all license daemons (both lmgrd and all vendor daemons) on all nodes.

The utility shuts down all daemons specified in the default license file, which is vendor-specific, or in the license file pathname as defined by the environment variable LM_LICENSE_FILE.

By default, the SoftWindows licensing is automatically restarted by a line in the file /etc/inittab (or on SunOS at reboot by a line in /etc/rc.local). For details of how to shut down FLEXlm refer to “To shut down FLEXlm.”

lmhostid

Prints the host ID value on any machine supported by FLEXlm.

lmremove

Removes a user's license for a specified product and returns the license to the pool of available licenses.

This could be required if there is a system failure on the node where the user is running the software. Due to the way TCP works it can take several hours for the license server to detect that the user's system has failed. This situation sometimes leaves the license in an unusable state.

Syntax

lmremove [-c file] feature user host display

The user host display information is obtained from the output of the command lmstat -a.

The lmremove utility removes all instances of user on host on display from usage of feature. If the optional -c file parameter is specified, the indicated file is used as the license file. You should protect the execution of lmremove, since removing a user's license can be disruptive.

lmreread

Instructs the license daemon to reread the license file and start all new vendor daemons that have been added. In addition, all preexisting daemons will be signaled to reread the license file for changes in feature-licensing information.

If an optional daemon name is specified, only the named daemon will reread the license file. In this case, lmgrd does not reread the license file.

lmstat

Displays the status of all network licensing activities to allow you to monitor license management operations, including:

  • Which daemons are running

  • Users of individual features

  • Users of features served by a specific daemon

The lmstat utility allows the following options:

Table 6-1. lmstat Options

Option

Description

-a

Display all licensing information.

-A

List all active licenses.

-c license_file

Use license_file.

-S [daemon]

Restrict output to one daemon, and the features and users of that daemon.

-f [feature_name]

List users of named feature or all features if no feature name is given.

-i [feature_name]

Prints information about the named feature or all features if no feature name is given.

-l [regular expression]

List users of matching license(s).

-s [server_name]

Display status of named server node or of all servers if no server name is given.

-t value

Set lmstat timeout to value.



Note: The command lmremove uses the output from lmstat -a.


lmswitchr

Switches the report writer (REPORTLOG) log file for the specified feature.

Imver

Reports the FLEXlm version of the library or binary. Usage is:

lmver [filename] 

If filename is specified, the FLEXlm version incorporated into this file is displayed; otherwise lmver looks for the library file liblmgr.a to detect its version.

Hostids for FLEXlm-supported machines

FLEXlm uses different machine identifications for different machine architectures. For this reason, the Ethernet address is used on some platforms as the host ID.

An Ethernet address is a 6–byte string, with each byte comprising two hexadecimal digits. You should specify all 12 hex digits when using an Ethernet address as a hostid. For example, if the Ethernet address is 8:0:20:0:5:ac, you would specify 0800200005AC as the hostid.

The program lmhostid will print the exact hostid that FLEXlm expects to use on any host.

Type:

echo `/etc/sysinfo –s`16o p | dc 

to obtain the required hostid.

Further Information

The FLEXlm End User's manual and lists of frequently asked questions relating to FLEXlm are available at the following Web sites:

http://www.globetrotter.com (US)

http://www.ptsdirect.co.uk (UK)

Enter the site, and under 'Category' select 'licensing', then select FLEXlm End User Manual.