dtsession Command
Purpose
Manages a CDE session.
Syntax
dtsession [options] ...
Description
The dtsession command provides session management functionality, compliant with ICCCM 1.1, during a user session, from login to logout. It starts a window manager and allows users to save a session, restore a session, lock a session, start screen savers, and allocate colors for desktop-compatible clients.
- Initializing a session
- Starting a window manager
- Restoring a home or current session
- Providing session lock on command or timeout
- Providing session screen saver on command or timeout
- Acting as a color allocation server for other desktop clients
- Saving a home or current session
- Displaying confirmation dialog at logout
- Displaying session selection dialog at logout
- Terminating a session
Sessions
A session is the collection of applications, settings, and resources that are present on the user desktop. Session management is a set of conventions and protocols that allow a special session manager, such as dtsession, to save and restore a user session. A user can log in to a system and be presented with the same set of running applications, settings, and resources that 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, dtsession supports the notion of a current and a home session.
- Initial session
- When a user logs in to the desktop for the first time, dtsession generates the user's initial session by using system default values. For more information, refer to Session Resource Management and Session Application Management.
- Current session
- The user session that is running 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, the current session is automatically saved. When the user next logs in to the desktop, the previously saved current session is restarted. The desktop is restored to the same state it was in when the user last logged out.
- Home session
- Another option restores the desktop 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, then sets the Style Manager Startup so that the desktop starts that session every time the user logs in.
- Display-specific sessions
- To run a specific session for a specific display, users can create
a display-specific session. To do so, users can copy the $HOME/.dt/sessions directory
to $HOME/.dt/display,
where display is the real, unqualified host name (for example,
pablo:0
is valid, butpablo.gato.com:0
orlocal:0
is not). When the user logs in on displaypablo:0
, that display-specific session takes precedence.
ICCCM Session Management Protocol
For an application to be saved upon logout and restarted upon login, it must participate in a simple session management protocol. The dtsession command supports the ICCCM 1.1 Session Management Protocol.
Applications that want to save their state can take part in the WM_SAVE_YOURSELF protocol. To do so, an application requires to set the WM_SAVE_YOURSELF property on only one of its top-level windows. When a session is saved, dtsession sends the application's top-level window a WM_SAVE_YOURSELF client message. The application proceeds to quietly save its state. The application cannot interact with the user in any way while it is saving its state. Because an application likely saves its state into a file, the session manager provides a convenience function, DtSessionSavePath, which returns a full path name of a file in which an application can save its state. While the application is saving its state, dtsession awaits notice from the application that it is finished. To tell dtsession that the save is complete, the application must update the WM_COMMAND property on its top-level window.
The WM_COMMAND property on an application's top-level window serves two purposes. First, a change of this property indicates to dtsession that an application is finished saving its state and dtsession can proceed to the next application. Second, the WM_COMMAND property value is expected to contain the command line that dtsession uses to restart the application at session startup. If an application is started with a full path name, it must use the full path name when setting the WM_COMMAND value. Applications that do not require to save their state but want to be restarted can set the WM_COMMAND value once during application startup.
Restoring a Session
- Display-specific current of home session
- Current or home session
- Initial session
Session Resource Management
- Loads the system default resources.
- Merges any system administrator-specified resources.
- Merges any user-specified resources.
The desktop default resources can be found in the /usr/dt/config/$LANG/sys.resources file. These resources are made available to each user session through the RESOURCE_MANAGER property. Do not edit this file because it is unconditionally overwritten during subsequent desktop installations.
By creating a /etc/dt/config/$LANG/sys.resources file, a system administrator can override system default resources or specify more resources. Because this file is merged into the desktop default resources during session startup, only new or updated resource specifications must be placed in this file. It is preferable to making a copy of the desktop default resource file. Resources that are specified in this file are made available to each user session through the RESOURCE_MANAGER property. Resources that are specified in this file take precedence over those resources that are specified in the desktop default resource file.
By editing the $HOME/.Xdefaults file, a user can override the desktop default and system administrator resources. Resources that are specified in this file are made available to only that user session through the RESOURCE_MANAGER property and take precedence over those resources that are specified in the desktop default or system administrator resource files.
The ReloadResources action instructs the session manager to reload the RESOURCE_MANAGER with the system-specified, system administrator-specified, and user-specified resources. It makes available to new applications changes that were made to system administrator-specified or user-specified resource files.
Session Application Management
At session startup, the session manager restarts any applications that were saved as part of the session. The system's default set of applications to be restored as part of the user's initial session can be found in the /usr/dt/config/$LANG/sys.session file. Do not edit this file because it is unconditionally overwritten during subsequent desktop installations.
A system administrator can replace the set of applications that are restored as part of the user's initial session by creating a /etc/dt/config/$LANG/sys.session file. Unlike the resource files, this file is used as a complete replacement for the desktop default file, so you can make a copy of the system default file and make any necessary modifications.
The Window Manager
The dtsession command starts the window manager. By default, /usr/dt/bin/dtwm is started. An alternative window manager can be specified by using the wmStartupCommand resource. For more information, refer to the Workspace Manager specification.
The Style Manager
The style manager provides the interface by which a user can change various desktop and X server settings for the current session. For more information, refer to the Style Manager specification.
The Color Server
- foregroundColor
- Controls whether a pixel is allocated for the foreground color.
- dynamicColor
- Specifies whether read-only colors are allocated.
- shadowPixmaps
- Specifies whether colors are allocated for top shadow or bottom shadow.
- colorUse
- Limits color allocation.
- writeXrdbColors
- Specifies whether the *background and *foreground resources are placed in the resource database.
Session Lock
The dtsession command provides locking of session. The current session can be locked directly by pressing the lock icon on the front panel. If supported by the X server, the current session can be locked after a specified period of inactivity. To unlock the session, users must enter their login password, the login password for the root user, or the login password for any of the users specified by the keys resource. See Screen Lock and Screen Save Resources for more information on the keys resource.
The dtsession command is a PAM-enabled session manager with service name dtsession. It supports traditional local UNIX authentication as well as PAM authentication for unlocking the session. Additional reauthentication functionality, such as that required by DCE, can be added by individual vendors.
System-wide
configuration to use PAM for authentication is set by establishing
root user permissions and modifying the value of the auth_type attribute
in the usw stanza of the /etc/security/login.cfg file
to PAM_AUTH
.
dtsession auth required /usr/lib/security/pam_aix
Screen Savers
The dtsession command provides support for the launching of external screen savers as a part of session locking from the front panel or, if supported by the X server, after a specified period of inactivity. Refer to the Screen Saver specification for information as to how screen savers are integrated into the desktop.
X Server Screen Saver Extensions
The dtsession command's ability to provide session lock or screen saver launch after a specified period of inactivity depends upon the availability of an X server screen saver extension. The dtsession command supports the X Consortium Sample X11 Screen Saver Extension 1.0 and the HP X Screen Saver Extension. The ability of the dtsession command to recognize both, either, or none of these extensions is vendor-specific.
Starting the Session Manager
The dtsession command must be started from the Xsession script. Xsession is described in the login manager specification. Although starting Xsession from dtlogin as part of the default login sequence is recommended, some systems allow proxy programs, such as xinit, x11start, or startx, to start Xsession.
Color Server Resources
Item | Description |
---|---|
colorUse |
|
dynamicColor |
|
foregroundColor |
|
shadowPixmaps |
|
writeXrdbColors |
|
Screen Lock and Screen Save Resources
Item | Description |
---|---|
keys |
|
passwordTimeout |
|
Miscellaneous Resources
Item | Description |
---|---|
queryServerSettings |
|
saveFontPath |
|
wmStartupCommand |
|
Exit Status
The following exit values are returned:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
Examples
- To start the session manager from the command line without restoring
the previous session, enter:
dtsession -norestore
Location
/usr/dt/bin/dtsession
Files
Item | Description |
---|---|
/usr/dt/config/$LANG/sys.session | The desktop default set of applications for the user's initial session. |
/etc/dt/config/$LANG/sys.session | System administrator-specified set of applications for the user's initial session. |
/usr/dt/config/$LANG/sys.resources | The desktop default resources. |
/etc/dt/config/$LANG/sys.resources | The system administrator-specified resources. |
$HOME/.Xdefaults | The user-specified resources. Note: The dtsession command
stores session information in $HOME/.dt/display or
$HOME/.dt/sessions. The content of these
directories must not be directly edited by the user.
|
/usr/dt/app-defaults/$LANG/Dtsession | Default dtsession resources. |