Terminating Active User Sessions on Customer Site

The License Manager Administration Library provides a set of API functions for terminating active user sessions on the License Manager machine. When the sessions are terminated, all the license tokens allocated to the user are reclaimed by the License Manager.

As a software vendor you need to create a utility or an interface using these APIs and allow termination of active user sessions.

NOTE   Typically, License Manager administration tasks are performed by the system administrators on the customer's site. The system administrators must have administrator user rights for the RMS License Manager host machine. For UNIX-based machines, the system administrator must also to be a part of the sudoers list to perform the TUS action.

For example, if an end user goes on a vacation without shutting down the machine, the application continues to consume licenses from the License Manager. This results in the license getting wasted. Therefore, the system administrator is required to log on (physically or remotely) to the machine where the License Manager is installed and terminate all the active sessions for a particular user and host. When the sessions are terminated, all the license tokens allocated to the user are reclaimed by the License Manager.

Terminating the active sessions of one or more user and host does not impact the active sessions of other users.

The License Manager identifies active sessions (on the machine where the application is running) using the following attributes:

>Hostname (mandatory)

>Username (mandatory)

>X-display name (optional)

>Vendor/application defined share ID (optional)

Usage data corresponding to the terminate action for killing active sessions is stored in the lservsta usage log file in extended mode only.

File Name Mode Transaction ID Action
lservsta Default 2 Termination of active user sessions
lservsta Extended 19 Termination of active user sessions

API Workflow for Terminating Active User Sessions

Termination affects only the existing active session at the time of processing the termination call. The API workflow for terminating active sessions for a particular user are:

NOTE   Refer to the Sentinel RMS API Reference Guide for details about the API parameters in the C, Java, .NET sections under the LMAdmin API. You may also use the sntl_lmadmin sample program included in the Sentinel RMS SDK.

1.Log on to the License Manager.

2.Call the sntl_lmadmin_context_new API and pass the following arguments:

a.server_name: Name of the contact server to be specified as NULL, localhost, or loopback address.

b.server_port: Port number on which the License Manager is configured.

c.attr: This is an optional attribute that can be passed. (It is set using the sntl_lmadmin_attr_set API). To apply default attribute settings, pass NULL.

NOTE   This API provides an output in the form of admin_context.

3.Call the sntl_lmadmin_post API and pass the admin_context as an argument. The admin_context supplied as an argument must be created with any of the following values: NULL, localhost, or loopback address.

4.Mandatorily include the hostname and username of the client machine in the input xml.

5.License Manager identifies all the session keys (where the hostname and username combination matches) and adds them to the list of terminated keys.

6.License Manager reclaims the tokens issued for all the terminated keys.

The system administrator is notified when the session is terminated, however, the licensed application is informed only on the next update/refresh call. Post session termination, when the application sends an update/refresh call, the License Manager returns a failure message (SNTL_USER_SESSION_TERMINATED). In case of RMS v9.6 or later clients, a message is sent to the application to stop sending further update calls; however older clients continue to send update calls which are consistently rejected by the License Manager by returning the SNTL_LICENSETERMINATED error.

NOTE   The sntl_lmadmin_post API terminates a user session which is created by associating the feature with the key_holdtime property. The License Manager does not hold on to the license till the hold time is over and reclaim the token.

Restarting Terminated User Sessions

A terminated user session can become active under the following scenarios.

>Licensed application is restarted.

>Any new login/request call from the licensed application results in the formation of a new session.

>License Manager is restarted (clients prior to RMS v9.6)

See Also:

Troubleshooting and FAQs > Terminate User Session