Home > Articles

Like this article? We recommend

Integrating Solaris Resource Manager Software

Integrating Solaris Resource Manager software with Sun Ray requires the Fair Share Scheduler (FSS) as the system-wide default scheduler. The following method requires a reboot, although the reboot is not strictly necessary.

NOTE

The process for migrating a running system into the FSS without rebooting is documented in the Sun Blueprints OnLine article titled "Resource Management in the Solaris 9 Operating Environment." Also documented in the "Resource Management in the Solaris 9 Operating Environment" article are important details about when to run other scheduling classes simultaneously with the FSS.

Sun Ray1# dispadmin -d FSS
Sun Ray1# init 6

Aggregate User Processes

Users initiate many processes during their normal workflow. For example, a simple GNOME session typically employs about forty processes. While these processes work together to present users with an integrated desktop environment, Solaris Operating System (Solaris OS) treats each process as an independent entity. To meaningfully control consumption of key system resources, the system must treat all of the processes belonging to a single user as a single entity.

In Solaris Resource Manager software, the project container provides a convenient mechanism for aggregating user processes. Although technically a project might contain the processes of multiple users, placing each user within a separate project enables the defined resource constraints to individually operate on users.

The simplest way to define a project is to add it to the local project repository /etc/project. Each Sun Ray user needs a dedicated project, that is, a project for which the user is the sole user. By convention, projects for users are prefixed with user (user-dot).

Sun Ray1# projadd -c "Smith, Mary" -U ms12345 -p 84855 user.ms12345

The parameters to projadd have a similar context to those of useradd:

  • -c argument specifies a comment.

  • -U designates the usernames belonging to the project.

  • -p gives a unique identifier for the project (similar to a UID).

  • Like useradd, the last parameter denotes a common name for the project entry.

By default a project is not resource constrained. However, common Solaris utilities such as prstat(1M) can aggregate their output by project.

To add resource controls to the project entry in /etc/project, edit the file and append the resource controls without line breaks to the appropriate entries. An automated script is provided to accomplish this without manually editing /etc/project.

Control CPU Shares

Controlling the CPU shares of Sun Ray users requires the presence of a project.cpu-shares constraint. Users should not be able to modify the number of CPU shares allotted to their projects, and the share limit should be enforced when a project hits the threshold. Appending the following to a project entry specifies these limits.

project.cpu-shares=(privileged,1,deny)

Generically, resource controls are specified by triplets (type, value, and action). The triplet in the code example (privileged,1,deny) sets a control on the project's CPU shares with a value of 1 (1 share) that denies further shares when the 1 share threshold is reached; superuser (or privileged) permissions are required to change this value. Refer to the project manual page project(4) for more details

Multiple resource constraints of type project.cpu-shares might exist for a single project. However, this solution assumes that only a single project.cpu-shares constraint exists for each project; additional constraints on cpu-shares might lead to unexpected results.

The complete line in /etc/project should look similar to the following. Note that the entry should be constrained to a single line in the file, without line continuation.

user.mary:12345:Smith, Smith:marys::project.cpu-shares=(privileged,1,deny)

Now when the individual Mary Smith (username marys) logs into the system, or starts a process via cron, the user.marys project will have 1 share of the CPU. If Smith has existing processes, they will inherit this limit.

Using Scripts to Allocate Shares Automatically

With only a little scripting, we can automatically increase a user's shares whenever the user inserts a smart card into a Sun Ray DTU. The Sun Ray command utaction is the mechanism for specifying commands to execute when users insert or remove cards at a DTU. With utaction, administrators can either specify a time delay for the action, or alternatively specify that the action should be taken immediately.

An unmodified Sun Ray server installation starts two utaction processes for each card user when a user removes the card. The first process immediately locks the screen via utxlock. (This can be modified to specify a time delay, for example, two minutes, so if a user re-inserts the card within two minutes of removing it, the user does not need to unlock the screen.) The second process performs housecleaning after a user logs out of a session.

Because utaction operates on card insert and remove events, it cannot be used to control non-card Sun Ray users. However, with the resource constrained project(s) just created, the commands specified to utaction increase or decrease a user's CPU shares appropriately for card-based users.

Let's start with the scripts that actually increase or decrease a user's CPU shares. For now, assume the utaction command was invoked properly, and it provides us with the user name (sometimes referred to as the user ID, however, not the numeric ID). The connectme.sh and disconnectme.sh scripts operate on this user name, accepted as a single argument.

When a user inserts a smart card, we want to run the connectme.sh script.

#!/bin/sh
# M. Smith, December 2003
# connectme.sh - when a user inserts their card, increase
# the number of CPU shares for their project
#
# requires $1 to be a valid username, and
# a user.$1 project in /etc/project, with a project.cpu-shares constraint

prctl -t privileged -e deny -n project.cpu-shares -r -v 50 -i project user.$1

When user Smith inserts her card, or connects to her Sun Ray session, this script sets the CPU shares for her project to 50. The call to the prtctl command replaces (-r) the first resource control (identified by the -n argument, here project.cpu-shares) with the new triplet specified by the type (-t), value (-v), and action (-e). The final arguments to prtctl indicate to what entity the new resource control should apply, namely, a project entity (-i project) identified by user.$1 (in this example, user.marysmarys).

Similarly, when Smith removes her card from a Sun Ray, her shares should return to 1, as shown in the following disconnectme.sh script.

#!/bin/sh
# M. Smith, December 2003
# disconnectme.sh - when a user removes their card, decrease
# the number of CPU shares for their project
#
# requires $1 to be a valid username, and
# a user.$1 project in /etc/project, with a project.cpu-shares constraint

prctl -t privileged -e deny -n project.cpu-shares -r -v 1 -i project user.$1

Can you see the difference between the two scripts? The value (-v) argument to the prctl command is the only difference. Therefore, we can consolidate both into a single script named adjustshares.sh and pass a new argument specifying the number of shares (depending on whether the user inserts or removes the card).

#!/bin/sh
# M. Smith, February 2004
# adjustshares.sh - adjust a user's shares whenever they insert or
# remove their smartcard from a Sun Ray
#
# requires $1 to be a valid username,
# requires $2 to be a valid number of cpu-shares for the user's project, and
# a user.$1 project in /etc/project, with a project.cpu-shares constraint

prctl -t privileged -e deny -n project.cpu-shares -r -v $2 -I project user.$1

Now that the adjustshares.sh script is defined, we turn our attention to invoking utaction. For controlling a user's CPU shares, the utaction process must be active throughout the lifetime of the desktop session.

Preventing Users From Modifying Share Limits

To prevent a user from circumventing the utaction process and keeping shares increased even though the card is removed, utaction must be run as root user. Solaris OS provides a handy mechanism for doing this. When a user successfully authenticates to the system, the system must perform certain tasks that the user does not normally have permission to do. For example, when a user logs into a system console, the system grants to the user read and write permissions for the console device. Similarly, these changes must be undone when the user logs out. These changes are symmetrically made in Xstartup and Xreset.

NOTE

An additional script, Xsetup, can be used to set up the X server before the authentication screen is displayed. Additional files exist; refer to the FILES section of the dtlogin(1X) manual page for more details.

FIGURE 1 depicts the time line of a user session.

Figure 1FIGURE 1 Structure of an X11 Session

In FIGURE 1, the grey boxes represent functions that execute with root permissions immediately before and after a user's session. The system default Xstartup and Xreset scripts are maintained in /usr/dt/config.

Preserving Share Limits Before Patches and Upgrades

Because the scripts in /usr/dt/config might be changed by patches or Solaris upgrades, it is considered best practice to copy these files into /etc/dt/config, and modify them there. Be sure to make the script executable, otherwise the X session will not start correctly (the dtlogin screen will reappear).

Alternatively, the default scripts in /usr/dt/config could be sourced from the new scripts in /etc/dt/config, which would automatically incorporate any changes to the default scripts.

The dtlogin process searches the /etc/dt/config directory first, and uses the scripts there if they exist with the proper permissions. The /etc/dt/config does not exist by default, so you might need to create it.

Sun Ray# mkdir -p /etc/dt/config
Sun Ray# cp /usr/dt/config/Xstartup /etc/dt/config
Sun Ray# cp /usr/dt/config/Xreset /etc/dt/config

For simplicity, this article sources the default scripts /etc/dt/config/Xstartup.

#!/bin/ksh

# the corresponding script in /usr may be modified by patches, etc.
# get the latest version
. /usr/dt/config/Xstartup

# then invoke utaction (place in background)
/opt/SUNWut/bin/utaction -i -c "adjustshares.sh $USER 50" -d "adjustshares.sh $USER 1" &

Adjusting Background Processor Shares

The utaction command terminates when the user's session is destroyed; it does not run the disconnect command before doing so. If the user logs out, or the session is reaped according to administrative policies, the user still has 50 shares. To rectify this, run the adjustshares.sh script in the Xreset script.

Now any background processes started by the user will have fewer shares of the processor /etc/dt/config/Xreset.

#! /bin/ksh

# the corresponding script in /usr may be modified by patches, etc.
# get the latest version
. /usr/dt/config/Xreset

# then invoke the adjust shares script 
adjustshares.sh $USER 1

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020