CentOS Startup Programs and Session Configuration

From Techotopia
Revision as of 21:42, 1 February 2016 by Neil (Talk | contribs) (Text replacement - "<google>BUY_CENTOS</google>" to "<htmlet>centos5</htmlet>")

Jump to: navigation, search
PreviousTable of ContentsNext
Configuring the CentOS GNOME File ManagerCentOS Desktop Keyboard Shortcuts


You are reading a sample chapter from the CentOS 5 Essentials Essentials book.

Purchase a copy of the fully updated CentOS 8 edition in eBook ($24.99) or Print ($36.99) format

CentOS 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 260 pages. Learn more...

Buy Print Preview Book


By default, the system starts a number of different programs each time a user logs into a desktop session. Sometimes the default list includes programs that are not needed by every user. On other occasions, additional programs are required by the user, or the user may wish for any currently running programs to be automatically restarted next time that user logs in to the desktop. In this chapter we will look at configuring programs to auto-load when a user logs in and how to create and manage sessions.


Contents


Session Managed and Non-Session Managed Programs

Programs in the context of the GNOME desktop fall into two categories; those that are session managed and those that are not. Session managed programs are aware that they are running in a session and are able to react to notifications from the session manager. A session managed program, for example, will save all the current settings and data when informed by the session manager that the session is ending. Depending on the session configuration settings, the program will then restart with the previous settings and data the next time the session starts. Programs that are not session managed will not be able to respond to notifications that the session is ending and will lose any settings and data that have not already been manually saved by the user.

Understanding Sessions

Each time a user logs into the CentOS GNOME desktop they create an instance of a session. This session lasts right up until the point that the user logs out of the desktop or switches to another user. When a session starts, a number of programs are started automatically by the session manager. Many of these are required for the desktop environment to function and are largely invisible to the user. Others may be applications which the user prefers to have started each time she logs in. In addition custom sessions can be created, each with a different set of default programs configured to start up, that can then be selected by users when logging into the desktop.


Creating a New Session

When The GNOME desktop is installed along with the CentOS operating system a small selection of sessions are also installed. When the login screen appears, clicking on the Sessions option at the bottom of the screen lists these sessions. Typically the first time user will log in using the session named GNOME. It is possible, however, to create new sessions that are configured to start specific programs automatically. New sessions are created from the Sessions configuration tool which is launched via the System -> Preferences -> More Preferences -> Sessions menu option. Once loaded, the dialog will display with the Session Options panel preselected:

The CentOS Session Options Screen


To create a new session, click on the Add button and enter a descriptive name for the session and then exit from the Sessions tool. Next time you encounter the login screen your new session should be listed and available for selection when you click on the Sessions option.

Configuring Session Preferences

The Session Options panel of the Session configuration tool provides three preferences that apply to all sessions. These options are as follows:

  • Show splash screen on login – Controls whether or not the CentOS splash screen is displayed when the user logs in. This small window appears after the user has entered the login credentials and displays information as each component of the desktop environment is loaded.
  • Ask on logout – Controls whether a confirmation dialog is displayed when the user logs out of the current desktop session.
  • Automatically save changes to session – When selected, this option causes the status of the currently running session managed programs to be saved when the user logs out of the session and then restarted the next time the user logs in. If, for example, the user was editing a file using the GEdit text editor, the editor would start with the same file opened next time the user logs in. Note that not all programs are session managed, so may not restart automatically even if this option is selected.

Configuring the Current Session

The Current Session page of the Session management tool provides the ability to modify various aspects the programs that are currently running in the session. When selected, the panel appears as illustrated in the following figure:


The CentOS desktop Current Sessions configuration screen


The main area of this screen lists all the currently running programs within the current desktop session. Scrolling through the list will display a number of background processes together with any applications that you have started on the desktop since logging in. Below the program list are a number of buttons and menus that allows a variety of factors to be configured:

  • Order – Specifies the priority given to the currently selected program during the session start up process. The lower the value, the higher the priority for the program during startup. To change the priority of a program, select it from the list, change the Order value and click on the Apply button.
  • Style – Controls what happens to the selected program when the session restarts. Normal indicates the program should start automatically when the session starts. Restart causes the program to be restarted whenever it is exited or terminated. Trash disables autostart for the program. Settings causes the application to autostart using the same session settings that were configured during the last session instance.
  • Remove – Removes the currently selection program from the session. The program will terminate and, if the current session is saved, will not start next time the user logs in to the current session.

Configuring Startup Programs

So far we have looked primarily at configuring session managed programs. The Startup Programs page of the Sessions tool allows you to configure non-session managed programs to be automatically started when the user logs in:


The CentOS desktop Startup Programs configuration screen


To add a new program to the list, simply click on the Add button and use the Browse button in the resulting Add Startup Command window to navigate to the program to be started each time a user logs into the session. To disable autostart for the currently selected program simply click the Disable button. The label on button will then change to Enable and may then be used to re-enable the selected program if required.


<google>BUY_CENTOS_BOTTOM</google>



PreviousTable of ContentsNext
Configuring the CentOS GNOME File ManagerCentOS Desktop Keyboard Shortcuts