Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 2

Configuring Session Manager

Session Manager is responsible for starting the desktop and automatically saving and restoring running applications, colors, fonts, mouse behavior, audio volume, and keyboard click.

Using Session Manager, you can:

  • Customize the initial session for all desktop users

  • Customize the environment and resources for all desktop users

  • Change the session startup message

  • Change parameters for session startup tools and daemons

  • Customize desktop color usage for all users

What Is a Session?

A session is the collection of applications, settings, and resources present on the user's desktop. Session management is a set of conventions and protocols that enables Session Manager to save and restore a user's session. A user is able to log in to the system and be presented with the same set of running applications, settings, and resources as were present when the user logged off. When a user logs in to the desktop for the first time, a default initial session is loaded. Afterward, Session Manager supports the notion of a current and a home session.

The Initial Session

When a user logs in to the desktop for the first time, Session Manager will generate the user's initial session using system default values. By default, the File Manager and Introduction to the Desktop, a help volume, will start.

Current Session

The user's running session is always considered the current session, whether restored upon login from a saved home session, a saved current session, or the system default initial session. Based on the user's Style Manager Startup settings, when the user exits the session, Session Manager automatically saves the current session. When the user next logs in to the desktop, Session Manager restarts the previously saved current session, meaning that the desktop will be restored to same state as when the user last logged out.

Home Session

You can also have the desktop restored to the same state every time the user logs in, regardless of its state when the user logged out. The user can save the state of the current session and then, using the Style Manager Startup settings, have Session Manager start that session every time the user logs in.

Display-Specific Sessions

To run a specific session for a specific display, a user can create a display-specific session. To do this, the user can copy the HomeDirectory/.dt/sessions directory to HomeDirectory/.dt/display, where display is the real, unqualified host name (for example, pablo:0 is valid, pablo.gato.com:0 or unix:0 is not). When the user logs in on display pablo:0, Session Manager will start that display-specific session.

Starting a Session

Session Manager is started through /usr/dt/bin/Xsession. When the user logs in using the Login Manager, Xsession is started by default.

Optionally, the user can log in using the traditional character mode (getty) login, and start Session Manager manually using tools that start an X server, such as xinit. For example: xinit /usr/dt/bin/Xsession.

When a Session Starts

When Session Manager is started, it goes through the following steps to start the user's session:

  1. Sources the HomeDirectory/.dtprofile script

  2. Sources the Xsession.d scripts

  3. Displays a welcome message

  4. Sets up desktop search paths

  5. Gathers available applications

  6. Optionally sources HomeDirectory/.profile or HomeDirectory/.login

  7. Starts the ToolTalk® messaging daemon

  8. Loads session resources

  9. Starts the color server

  10. Starts the Workspace Manager

  11. Starts the session applications

    The following sections describe the steps listed above.

Sourcing the .dtprofile Script

At session startup, the Xsession script sources the user's HomeDirectory/.dtprofile script. The HomeDirectory/.dtprofile script is a /bin/sh or /bin/ksh script that enables users to set up environment variables for their sessions. For more information on setting up environment variables, see "Additional Session Startup Customizations".

If the HomeDirectory/.dtprofile script does not exist, such as when a user is logging in to the desktop for the first time, Xsession will copy the desktop default sys.dtprofile to HomeDirectory/.dtprofile.

The desktop default is /usr/dt/config/sys.dtprofile. To customize the sys.dtprofile script, copy sys.dtprofile from /usr/dt/config to /etc/dt/config and edit the new file.

Sourcing Xsession.d Scripts

After sourcing the HomeDirectory/.dtprofile script, the Xsession script sources the Xsession.d scripts. These scripts are used to set up additional environment variables and start optional daemons for the user's session. The default Xsession.d scripts are:

0010.dtpaths--documents customizable desktop search paths

0020.dtims--starts optional input method server

0030.dttmpdir--creates per-user, per-session temporary directory

0040.xmbind--sets up $XMBINDDIR to desktop default

There may be additional vendor-specific scripts in Xsession.d.

Xsession first sources all files in the /etc/dt/config/Xsession.d directory, followed by those in the /usr/dt/config/Xsession.d directory.

The desktop default Xsession.d scripts are located in the /usr/dt/config/Xsession.d directory. To customize an Xsession.d script, copy the script from /usr/dt/config/Xsession.d to /etc/dt/config/Xsession.d and edit the new file. You must have execute permission to perform this task.

Also, to have Xsession automatically source a script of your own, copy it to /etc/dt/config/Xsession.d.


Note - When you modify or create an Xsession.d script, make sure that any foreground commands you issue are of short duration, as the time taken by the command will directly affect session startup time. If a foreground command does not exit, the session startup will hang. Commands run in an Xsession.d script that you want to remain running for the duration of the session should be run in the background.


 
 
 
  Previous   Contents   Next