Настройка

GDM имеет множество интерфейсов настройки: точки подключения сценариев, настройка демона, настройки программы приветствия, глобальные параметры сеанса, интеграцию с настройками gnome-settings-daemon и параметрами сеанса. Подробнее это рассмотрено далее.

5.1 Точки подключения сценариев

Точки подключения сценариев GDM находятся в каталоге <etc>/gdm/:

Xsession
Init/
PostLogin/
PreSession/
PostSession/

Работа сценариев Init, PostLogin, PreSession и PostSession описана далее.

Для каждого типа есть сценарий c именем «Default», который будет выполнен по умолчанию и располагается в каталоге, соответствующем типу сценария. Так сценарий по умолчанию для типа Init<etc>/gdm/Init/Default. Если существует сценарий для дисплея, то он будет выполнен вместо сценария по умолчанию. Такие сценарии находятся в тех же каталогах, но их названия совпадают со значением DISPLAY X сервера для нужного дисплея. Например, если существует файл сценария <Init>/:0, то он будет выполнен для дисплея «:0».

All of these scripts are run with root privilege and return 0 if run successfully, and a non-zero return code if there was any failure that should cause the login session to be aborted. Also note that GDM will block until the scripts finish, so if any of these scripts hang, this will cause the login process to also hang.

When the Xserver for the login GUI has been successfully started, but before the login GUI is actually displayed, GDM will run the Init script. This script is useful for starting programs that should be run while the login screen is showing, or for doing any special initialization if required.

После успешной аутентификации пользователя GDM выполнит сценарий PostLogin, но до того, как выполнена установка сеанса, в том числе перед вызовом pam_open_session. Этот сценарий полезен для инициализации сеанса перед его стартом, например тут можно создавать домашние каталоги пользователей $HOME.

После инициализации сеанса GDM запустит сценарий PreSession, который полезен для проведения дополнительной инициализации сеанса. Например, для учёта сеансов.

When a user terminates their session, GDM will run the PostSession script. Note that the Xserver will have been stopped by the time this script is run, so it should not be accessed.

Внимание! Сценарий PostSession будет выполнен, даже если дисплей недоступен из-за ошибок ввода-вывода и подобных. Поэтому не гарантируется нормальная работа приложений X во время исполнения сценария.

Во время выполнения всех указанных сценариев переменная окружения $RUNNING_UNDER_GDM установлена в yes. Если сценарий используется совместно с другими менеджерами дисплеев, то это поможет определить, что сценарий вызван из GDM для выполнения специфичного кода.

5.2 Autostart Configuration

The <share>/gdm/autostart/LoginWindow directory contains files in the format specified by the "FreeDesktop.org Desktop Application Autostart Specification". Standard features in the specification may be used to specify programs that should auto-restart or only be launched if a GConf configuration value is set, etc.

Any .desktop files in this directory will cause the associated program to automatically start with the login GUI greeter. By default, GDM is shipped with files which will autostart the gdm-simple-greeter login GUI greeter itself, the gnome-power-manager application, the gnome-settings-daemon, and the metacity window manager. These programs are needed for the greeter program to work. In addition, desktop files are provided for starting various AT programs if the configuration values specified in the Accessibility Configuration section below are set.

5.3 Сценарий Xsession

There is also an Xsession script located at <etc>/gdm/Xsession which is called between the PreSession and the PostSession scripts. This script does not support per-display like the other scripts. This script is used for actually starting the user session. This script is run as the user, and it will run whatever session was specified by the Desktop session file the user selected to start.

5.4 Конфигурация демона

The GDM daemon is configured using the <etc>/gdm/custom.conf file. Default values are stored in GConf in the gdm.schemas file. It is recommended that end-users modify the <etc>/gdm/custom.conf file because the schemas file may be overwritten when the user updates their system to have a newer version of GDM.

Внимание! Ранние версии GDM содержат дополнительные параметры, которые более не поддерживаемые GDM.

Файл <etc>/gdm/custom.conf записан в формате keyfile (параметр-значение). Слова в квадратных скобках [ ] определяют названия секций, строки до знака равно (=) являются наименованиями параметров а после — значениями. Пустые и начинающиеся на октоторп (#) строки игнорируются.

The file <etc>/gdm/custom.conf supports the "[daemon]", "[security]", and "[xdmcp]" group sections. Within each group, there are particular key/value pairs that can be specified to modify how GDM behaves. For example, to enable timed login and specify the timed login user to be a user named "you", you would modify the file so it contains the following lines:

[daemon]
TimedLoginEnable=true
TimedLogin=you

Далее приведён полный список поддерживаемых параметров конфигурации:

5.4.1 [chooser]

Multicast
Multicast=false

If true and IPv6 is enabled, the chooser will send a multicast query to the local network and collect responses from the hosts who have joined multicast group.

MulticastAddr
MulticastAddr=ff02::1

This is the Link-local multicast address.

5.4.2 [daemon]

TimedLoginEnable
TimedLoginEnable=false

Автоматический вход в систему произойдёт под учётной записью TimedLogin по истечении TimedLoginDelay секунд неактивности на экране входа в систему. Это полезно для общедоступных терминалов и домашних систем. Если пользователь нажал клавишу на клавиатуре или использовал меню на экране, то время ожидания сбрасывается в TimedLoginDelay или 30 секунд, но не более. Если пользователь не ввёл имя учётной записи, а просто нажал ENTER при запросе имени пользователя, то GDM произведет автоматический вход в систему. При этом пароль не будет запрошен. За подробной информацией обращайтесь к подразделу «Безопасность-> Модуль PAM».

TimedLogin
TimedLogin=

Учётная запись под которой произойдёт автоматический вход в систему по истечении определённого промежутка времени неактивности.

If the value ends with a vertical bar | (the pipe symbol), then GDM will execute the program specified and use whatever value is returned on standard out from the program as the user. The program is run with the DISPLAY environment variable set so that it is possible to specify the user in a per-display fashion. For example if the value is "/usr/bin/getloginuser|", then the program "/usr/bin/getloginuser" will be run to get the user value.

TimedLoginDelay
TimedLoginDelay=30

Задержка в секундах перед автоматическим входом под учётной записью TimedLogin.

AutomaticLoginEnable
AutomaticLoginEnable=false

Если истина, то вход под учётной записью AutomaticLogin будет произведен немедленно. Аналогично автоматическому входу с задержкой 0 секунд.

AutomaticLogin
AutomaticLogin=

Учётная запись под именем которой произойдет немедленный вход в систему, если AutomaticLoginEnable установлено в истину.

If the value ends with a vertical bar | (the pipe symbol), then GDM will execute the program specified and use whatever value is returned on standard out from the program as the user. The program is run with the DISPLAY environment variable set so that it is possible to specify the user in a per-display fashion. For example if the value is "/usr/bin/getloginuser|", then the program "/usr/bin/getloginuser" will be run to get the user value.

User
User=gdm

Учётная запись под которой выполняется программа приветствия и другие графические приложения. Смотрите также описание параметра Group и раздел «Безопасность->Учётная запись пользователя и группы GDM».

Group
Group=gdm

Имя группы, под которой программа приветствия и другие графические приложения будут запущены. Смотрите также описание параметра User и раздел этого документа «Безопасность-> Учётные записи пользователя и группы GDM».

5.4.3 Параметры отладки

[debug]
Enable
Enable=false

To enable debugging, set the debug/Enable key to "true" in the <etc>/gdm/custom.conf file and restart GDM. Then debug output will be sent to the system log file (<var>/log/messages or <var>/adm/messages depending on your Operating System).

5.4.4 Параметры приветствия

[greeter]
IncludeAll
IncludeAll=true

If true, then the face browser will show all users on the local machine. If false, the face browser will only show users who have recently logged in.

When this key is true, GDM will call fgetpwent() to get a list of local users on the system. Any users with a user id less than 500 (or 100 if running on Oracle Solaris) are filtered out. The Face Browser also will display any users that have previously logged in on the system (for example NIS/LDAP users). It gets this list via calling the ck-history ConsoleKit interface. It will also filter out any users which do not have a valid shell (valid shells are any shell that getusershell() returns - /sbin/nologin or /bin/false are considered invalid shells even if getusershell() returns them).

If false, then GDM more simply only displays users that have previously logged in on the system (local or NIS/LDAP users) by calling the ck-history ConsoleKit interface.

Include
Include=

Set to a list of users to always include in the Face Browser. This value is set to a list of users separated by commas. By default, the value is empty.

Exclude
Exclude=bin,root,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,nobody4,noaccess,postgres,pvm,rpm,nfsnobody,pcap

Set to a list of users to always exclude in the Face Browser. This value is set to a list of users separated by commas. Note that the setting in the custom.conf overrides the default value, so if you wish to add additional users to the list, then you need to set the value to the default value with additional users appended to the list.

5.4.5 Параметры безопасности

[security]
DisallowTCP
DisallowTCP=true

Если истина, то к параметрам запуска локального X сервера всегда добавляется -nolisten tcp, что запрещает TCP соединения. Это более безопасная настройка при использовании удалённых соединений.

5.4.6 Поддержка XDCMP

[xdmcp]
DisplaysPerHost
DisplaysPerHost=1

Чтобы предотвратить атаки путем переполнения очереди ожидающий соединений, GDM разрешает только одно соединение с одной машины. Если необходимо предоставить больше дисплеев для машин с несколькими экранами, то следует увеличить этот параметр.

Внимание! Количество допустимых локальных дисплеев не ограничивается. Эта опция ограничивает только удалённые соединения через протокол XDMCP.

Enable
Enable=false

Установка в истину включает поддержку XDMCP протокола, разрешая GDM управлять удалёнными дисплеями и X терминалами.

Запросы прослушиваются на UDP порту 177. См. описание параметра «Port» для дополнительных сведений.

Если GDM собран с соответствующими опциями, то управление удалёнными дисплеями может быть осуществлено через библиотеку TCP Wrappers. Имя сервиса — gdm

You should add

gdm:.my.domain
to your <etc>/hosts.allow, depending on your TCP Wrappers configuration. See the hosts.allow man page for details.

Внимание! XDMCP - небезопасный протокол, и на сетевом экране следует заблокировать UDP порт 177 до тех пор, пока он действительно не понадобится.

HonorIndirect
HonorIndirect=true

Разрешает XDMCP INDIRECT выбор (т.е. удалённое исполнение программы gdmchooser) для X терминалов, не имеющих собственных обозревателей дисплеев.

MaxPending
MaxPending=4

GDM фиксирует длину очереди ожидающих соединений для предотвращения атак на сервис. Одновременно могут стартовать только MaxPending дисплеев.

Этот параметр не ограничивает количество управляемых удалённых соединений. Он ограничивает только количество дисплеев инициирующих соединение одновременно.

MaxSessions
MaxSessions=16

Определяет максимальное количество одновременно обслуживаемых соединений удалённых дисплеев. То есть общее количество удалённых дисплеев на данной машине.

MaxWait
MaxWait=30

Когда GDM готов обслужить дисплей, он отправляет пакет ACCEPT, содержащий уникальный идентификатор сеанса, который в дальнейшем будет использован в протоколе XDMCP.

Затем GDM поместит идентификатор сеанса в очередь ожидающих соединений для дисплея в ответ на запрос MANAGE.

Если ответ не был получен в течение MaxWait секунд, GDM объявит дисплей недоступным и удалит из очереди, освободив место для других дисплеев.

MaxWaitIndirect
MaxWaitIndirect=30

Этот параметр определяет максимальное количество секунд между тем, как пользователь выбирает машину и последующим непрямым запросом соединения с машиной. По истечении времени информация о выбранной машине стирается и место для непрямых запросов освобождается для других дисплеев. Эта информация также может быть стёрта, если больше, чем MaxPendingIndirect машин пытаются послать непрямые запросы.

PingIntervalSeconds
PingIntervalSeconds=60

If the Xserver does not respond in the specified number of seconds, then the connection is stopped and the session ended. When this happens the daemon dies with an ALARM signal. Note that GDM 2.20 and earlier multiplied this setting by 2, so it may be necessary to increase the timeout if upgrading from GDM 2.20 and earlier to a newer version.

Внимание! Ранее GDM использовал параметр PingInterval, который указывался в минутах. В большинстве случаев этот параметр желательно устанавливить менее минуты, например если необходимо использование XDMCP (лабораторные терминалы), задержка более чем 15 секунд действительно означает, что терминал выключен или перезагружается, и поэтому необходимо завершить сеанс.

Port
Port=177

Порт UDP, который gdm прослушивает на XDMCP запросы. Изменяйте его, только если вы уверены в ваших действиях.

Willing
Willing=<etc>/gdm/Xwilling

Когда машина посылает пакет WILLING в ответ на QUERY, то она посылает строку, сообщающую статус этого сервера. Обычно это системный идентификатор, но можно создать сценарий, отражающий любое сообщение. Если такого сценария нет или значение параметра пустое, то будет послано сообщение по умолчанию. Если сценарий выполнился успешно и вернул сообщение, то будет отослана первая строка этого сообщения. Сценарий выполняется не чаще одного раза в три секунды для предотвращения DoS атак, путем забрасывания машины пакетами QUERY.

5.5 Настройка простой программы приветствия (Simple Greeter)

По умолчанию GDM использует программу приветствия «Simple Greeter» и она настраивается через GConf. Значения по умолчанию находятся в файле gdm-simple-greeter.schemas. Эти значения можно переопределить если учётная запись «gdm» имеет домашний каталог $HOME с правом записи, чтобы сохранять настройки GConf. Значения можно редактировать с помощью программ: gconftool-2 или gconf-editor. Допустимы следующие настройки:

Параметры конфигурации программы приветствия
/apps/gdm/simple-greeter/banner_message_enable
false (boolean)

Определяет, показывать ли приветствующее текстовое сообщение.

/apps/gdm/simple-greeter/banner_message_text
NULL (string)

Содержит текстовое сообщения приветствия.

/apps/gdm/simple-greeter/disable_restart_buttons
false (boolean)

Отражать ли кнопку перезагрузки системы на экране входа в систему.

/apps/gdm/simple-greeter/disable_user_list
false (boolean)

If true, then the face browser with known users is not shown in the login window.

/apps/gdm/simple-greeter/logo_icon_name
computer (string)

Содержит имя значка темы для отображения логотипа приветствия.

/apps/gdm/simple-greeter/recent-languages
[] (string list)

Set to a list of languages to be shown by default in the login window. Default value is "[]". With the default setting only the system default language is shown and the option "Other..." which pops-up a dialog box showing a full list of available languages which the user can select.

Users are not intended to change this setting by hand. Instead GDM keeps track of any languages selected in this configuration key, and will show them in the language combo box along with the "Other..." choice. This way, commonly selected languages are easier to select.

/apps/gdm/simple-greeter/recent-layouts
[] (string list)

Set to a list of keyboard layouts to be shown by default in the login panel. Default value is "[]". With the default setting only the system default keyboard layout is shown and the option "Other..." which pops-up a dialog box showing a full list of available keyboard layouts which the user can select.

Users are not intended to change this setting by hand. Instead GDM keeps track of any keyboard layouts selected in this configuration key, and will show them in the keyboard layout combo box along with the "Other..." choice. This way, commonly selected keyboard layouts are easier to select.

/apps/gdm/simple-greeter/wm_use_compiz
false (boolean)

Использовать ли менеджер окон compiz вместо metacity.

5.6 Параметры универсального доступа

This section describes the accessibility configuration options available in GDM.

5.6.1 GDM Accessibility Dialog And GConf Keys

The GDM greeter panel at the login screen displays an accessibility icon. Clicking on that icon opens the GDM Accessibility Dialog. In the GDM Accessibility Dialog, there is a list of checkboxes, so the user can enable or disable the associated assistive tools.

The checkboxes that correspond to the on-screen keyboard, screen magnifier and screen reader assistive tools act on the three GConf keys that are described in the next section of this document. By enabling or disabling these checkboxes, the associated GConf key is set to "true" or "false". When the GConf key is set to true, the assistive tools linked to this GConf key are launched. When the GConf key is set to "false", any running assistive tool linked to this GConf key are terminated. These GConf keys are not automatically reset to a default state after the user has logged in. Consequently, the assistive tools that were running during the last GDM login session will automatically be launched at the next GDM login session.

The other checkboxes in the GDM Accessibility Dialog do not have corresponding GConf keys because no additional program is launched to provide the accessibility features that they offer. These other options correspond to accessibility features that are provided by the Xserver, which is always running during the GDM session.

5.6.2 Accessibility GConf Keys

GDM offers the following GConf keys to control its accessibility features:

GDM Configuration Keys
/desktop/gnome/interface/accessibility
false (boolean)

Controls whether the Accessibility infrastructure will be started with the GDM GUI. This is needed for many accessibility technology programs to work.

/desktop/gnome/applications/at/screen_magnifier_enabled
false (boolean)

If set, then the assistive tools linked to this GConf key will be started with the GDM GUI program. By default this is a screen magnifier application.

/desktop/gnome/applications/at/screen_keyboard_enabled
false (boolean)

If set, then the assistive tools linked to this GConf key will be started with the GDM GUI program. By default this is an on-screen keyboard application.

/desktop/gnome/applications/at/screen_reader_enabled
false (boolean)

If set, then the assistive tools linked to this GConf key will be started with the GDM GUI program. By default this is a screen reader application.

5.6.3 Linking GConf Keys to Accessibility Tools

For the screen_magnifier_enabled, the screen_keyboard_enabled, and the screen_reader_enabled GConf keys, the assistive tool which gets launched depends on the desktop files located in the GDM autostart directory as described in the "Autostart Configuration" section of this manual. Any desktop file in the GDM autostart directory can be linked to these GConf key via specifying that GConf key in the AutostartCondition value in the desktop file. So the exact AutostartCondition line in the desktop file could be one of the following:

AutostartCondition=GNOME /desktop/gnome/applications/at/screen_keyboard_enabled
AutostartCondition=GNOME /desktop/gnome/applications/at/screen_magnifier_enabled
AutostartCondition=GNOME /desktop/gnome/applications/at/screen_reader_enabled

When an accessibility key is true, then any program which is linked to that key in a GDM autostart desktop file will be launched (unless the Hidden key is set to true in that desktop file). A single GConf key can even start multiple assistive tools if there are multiple desktop files with this AutostartCondition in the GDM autostart directory.

5.6.4 Example Of Modifying Accessibility Tool Configuration

For example, if GNOME is distributed with GOK as the default on-screen keyboard, then this could be replaced with a different program if desired. To replace GOK with the on-screen keyboard application "onboard" and additionally activate the assistive tool "mousetweaks" for dwelling support, then the following configuration is needed.

Create a desktop file for onboard and a second one for mousetweaks; for example, onboard.desktop and mousetweaks.desktop. These files must be placed in the GDM autostart directory and be in the format as explained in the "Autostart Configuration" section of this document.

The following is an example onboard.desktop file:

[Desktop Entry]
Encoding=UTF-8
Name=Onboard Onscreen Keyboard
Comment=Use an on-screen keyboard
TryExec=onboard
Exec=onboard --size 500x180 -x 20 -y 10
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Accessibility;
AutostartCondition=GNOME /desktop/gnome/applications/at/screen_keyboard_enabled

The following is an example mousetweaks.desktop file:

[Desktop Entry]
Encoding=UTF-8
Name=Software Mouse-Clicks
Comment=Perform clicks by dwelling with the pointer
TryExec=mousetweaks
Exec=mousetweaks --enable-dwell -m window -c -x 20 -y 240 
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Accessibility;
AutostartCondition=GNOME /desktop/gnome/applications/at/screen_keyboard_enabled

Note the line with the AutostartCondition that links both desktop files to the GConf key for the on-screen keyboard.

To disable GOK from starting, the desktop file for the GOK on-screen keyboard must be removed or deactivated. Otherwise onboard and GOK would simultaneously be started. This can be done by removing the gok.desktop file from the GDM autostart directory, or by adding the "Hidden=true" key setting to the gok.desktop file.

After making these changes, GOK will no longer be started when the user activates the on-screen keyboard in the GDM session; but onboard and mousetweaks will instead be launched.

5.7 Глобальные настройки сеанса

Программа приветствия GDM использует некоторые механизмы, что и сеанс рабочего места. Поэтому они используют многие общие параметры в GConf. Для всех таких параметров программа приветствия использует значения по умолчанию, пока они не будут переопределены: 1) установленной обязательной политикой GDM; 2) обязательной системной политикой. GDM устанавливает собственную обязательную политику, чтобы усилить безопасность.

5.8 Демон параметров GNOME

GDM включает следующие подключаемые модули gnome-settings-daemon: a11y-keyboard, background, sound, xsettings.

Они обеспечивают, например, фоновую картинку, шрифт и настройки темы, звуки и так далее.

С помощью GConf подключаемые модули можно отключить. Например, чтобы отключить звуковой модуль, следует использовать параметр /apps/gdm/simple-greeter/settings-manager-plugins/sound/active.

5.9 Параметры сеанса GDM

Сеансы GDM определяются в соответствии со спецификациями рабочего пространства FreeDesktop.org, которые можно получить по адресу: http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec.

By default, GDM will install desktop files in the <share>/xsessions directory. GDM will search the following directories in this order to find desktop files: <etc>/X11/sessions/, <dmconfdir>/Sessions, <share>/xsessions, and <share>/gdm/BuiltInSessions. By default the <dmconfdir> is set to <etc>/dm/ unless GDM is configured to use a different directory via the "--with-dmconfdir" option.

Сеанс можно запретить, добавив в файл рабочего места строку: Hidden=true.

GDM desktop files support a GDM-specific extension, a key named "X-GDM-BypassXsession". If the key is not specified in a desktop file, the value defaults to "false". If this key is specified to be "true" in a desktop file, then GDM will launch the program specified by the desktop file "Exec" key directly when starting the user session. It will not run the program via the <etc>/gdm/Xsession script, which is the normal behavior. Since bypassing the <etc>/gdm/Xsession script avoids setting up the user session with the normal system and user settings, sessions started this way can be useful for debugging problems in the system or user scripts that might be preventing a user from being able to start a session.

5.10 Параметры языка и пользовательских сеансов GDM

Сеанс пользователя по умолчанию и выбор языка находятся в файле ~/.dmrc. Этот файл создается при первом входе пользователя в соответствии с выбранными значениями. В дальнейшем значения могут быть изменены при последующем входе в систему. GDM запомнит последний выбор пользователя для следующего входа.

Файл ~/.dmrc записан в стандартном формате INI, имеет одну секцию [Desktop] и два параметра: Session и Language.

Параметр Session определяет базовое имя файла сеанса .desktop. Имя указывается без расширения .desktop. Параметр Language определяет язык по умолчанию. Если любой из этих параметров отсутствует, то используются общие значения по умолчанию. Обычно файл выглядит следующим образом:

[Desktop]
Session=gnome
Language=ru_RU.UTF-8