# KDM ハンドブック

Neal
Crook

    nac@forth.org

Steffen
Hansen

    stefh@dit.ou.dk

Developer
Lauri
Watts

    vampyr@atconnex.net

Reviewer
2000
Neal Crook
12/09/2000
0.05.02

この文書は &kdm; KDE ディスプレイ マネージャについて記述されています。 &kdm; は "ログイン マネージャ" としても知られています。

KDE
kdm
xdm
display manager
login manager

## はじめに

&kdm; provides a graphical interface that allows you to log in to a system. It prompts for login (username) and password, authenticates the user and starts to run a "session". &kdm; は xdm こと X ディスプレイマネージャに代わり「いつでも気軽に」使えるだけでなく、 xdm と比較して、 &kdm; はいくつかの点で優れています。

The user-interface to &kdm; is through two dialogue boxes. The main dialogue box has these features:

- A "Login" field for you to enter your username.

- A "Pass" field for you to enter your password.

- A region to the left of the "Login" and "Pass" fields which can be used to display either a static image or an analogue clock.

- (Optionally) a graphical image of each user (for example, a digitised photograph). Clicking on an image is equivalent to typing the associated username into the "Login" field. (This feature is an imitatation of the login box on IRIX).

- A "session type" drop-down box that allows &kdm; to be used to start sessions with various different window managers or desktop environments installed on the system, including KDE, KDE2 and GNOME.

- A "Go!" button that validates the username/password combination and attempts to start a session of the selected type.

- A "Cancel" button that clears the text from the "Login" and "Pass" fields.

- (Optionally) a "Shutdown" button that displays the "Shutdown" dialogue box.

The "Shutdown" dialogue box presents a set of radio buttons that allow one of these options to be selected:

Shutdown

  Shut the system down in a controlled manner, ready for power-down.

Restart

  Shut the system down and reboot. For systems that use Lilo, an optional drop-down box allows you to select a particular operating-system kernel to be used for the reboot.

Restart X Server

  Stop and then restart the X-server. Typically, you might need to use this option if you have changed your X11 configuration in some way.

Console Mode

  Stop the X-server and return the system to console mode. This is achieved by bringing the system down to run-level 3. Typically, the system manager might need to use this option before upgrading or re-configuring X11 software.

Pressing the "OK" button initiates the selected action; pressing the "Cancel" button returns to the main &kdm; dialogue box.

The next chapter explains how to configure &kdm;. Subsequent chapters describe how to configure your system in order to use &kdm;, how to build and install &kdm; from source, and how to learn more about &kdm; and the KDE project.

## Configuring &kdm;

This chapter assumes that &kdm; is already up and running on your system, and that you simply want to change its behaviour in some way. If your problem is more serious, skip forward to later chapters.

When &kdm; starts up, it reads its configuration from the file `kdmrc`. Since &kdm; must run before any user is logged in, it is not associated with any particular user. Therefore, it is not possible to have a user-specific `$HOME/share/config/kdmrc` file; all users share the common version of `kdmrc`, located in `$KDEDIR/share/config/kdmrc`. It follows from this that the configuration of &kdm; can only be altered by those users that have write-access to `$KDEDIR/share/config/kdmrc` (normally restricted to system administrators logged in as "root").

You can view the `kdmrc` file currently in use on your system (located by default at `$KDEDIR/share/config/kdmrc`), and you can configure &kdm; by editing this file. Alternatively, you can use the graphical configuration tool provided by the KDE Control Centre (under Applications System Login Manager), which is described in the KControl help files.

The remainder of this chapter describes the contents of the `kdmrc` file. If you are happy using the graphical configuration tool, there's no need to read any further.

There are four sections in `kdmrc`:

### KDM

このセクションのキーは以下のとおりです:

    StdFont
    FailFont
    GreetFont
    GreetString
    SessionTypes
    LogoArea
    LogoPixmap
    ShutdownButton
    Shutdown
    Restart
    ConsoleMode
    UserView
    Users
    NoUsers
    SortUsers
    GUIStyle

以下は各キーの簡単な説明です:

`*Font`

  フォント文字列は次のような形式になっています: Courier,12,5,iso-8859-1,50,0

`GreetString`

  &kdm; ログインウィンドウのタイトルです。

`SessionTypes`

  コンマで区切られた、セッション引数のリストで、通常は特定のウィンドウマネージャの選択に使用されます。 標準設定は `SessionTypes=kde,failsafe` となっています。

`LogoArea`

  Controls what appears in the lower left-hand corner of the login window. Can be either `KdmLogo` (in which case the image specified by `LogoPixMap` is displayed) or `KdmClock` (in which case a clock is displayed).

`LogoPixmap`

  LogoArea=KdmLogo として、 ログインウィンドウの左下の角に表示される画像を指定します。

`ShutdownButton`

  ShutdownButton は、いつ シャットダウン ボタンを表示するのかを制御するもので、 `All`、 `None`、 `RootOnly`、 `ConsoleOnly` のうちいずれかに設定できます。 `All` および `None` の意味は文字どおりです。 `ConsoleOnly` を選択すると、 リモート シャットダウンができなくなります。 `RootOnly` を選択すると、シャットダウンを続行する前に、 root のパスワードの入力が迅速に行なえます。

`Shutdown と Restart`

  それぞれシステムのシャットダウンと再起動を実行するコマンドです。 (標準設定: `/sbin/halt` と `/sbin/reboot` がそれぞれ割り当てられています。

`ConsoleMode`

  The command string used by the Console Mode option of the "Shutdown" button. (Default: `/sbin/init `3``). This option is not available under BSD.

`UserView`

  これを「`1`」に設定しておくと、 &kdm; ウィンドウ内にユーザがグラフィカルに表示されます。

`Users`

  コンマで区切られた、グラフィカルユーザビューで表示されるユーザ名のリストです。 `UserView` が 「1」 に設定され、 `Users` エントリがない場合、 &kdm; はパスワード ファイル `/etc/passwd` 内でユーザを探します。 表示されるユーザ情報は、本名のほか、ログイン名、ホーム ディレクトリ、および標準設定のシェルです - それ以外は省略されます。 &kdm; は `$KDEDIR/share/apps/kdm/pics/users/` を調べ、各ユーザのアイコンを探します。 `johndoe.png` というアイコンがあれば、 &kdm; はこれを使って johndoe というユーザを表示します。 なければ `default.png` を使います。

  &kdm; is able to handle icons of different sizes, but the result looks messy. The solution to this is to use an application such as KDE's Pixie, (or the GNU Image Manipulation Program, (gimp) or John Bradley's XV,) to convert all your images to the same size. A size of 64x64 should give enough resolution, and matches the default icons provided. These two programs can also be used to convert images from various formats into png format.

`NoUsers`

  コンマで区切られた、表示させないユーザ名のリストです。 `sync` や `shutdown` のような 「仮想ユーザ」をユーザ表示から排除します。

`SortUsers`

  これが 「`0`」 に設定されていると、 ユーザの一覧は読み込まれた順に表示されます。 標準設定では、ユーザはソート結果の順に表示されます。

`GUIStyle`

  `Motif` あるいは `Windows` のいずれかになります。

### KDMDESKTOP

This section is obsolete. In previous versions of &kdm; it could be used to control a background screen prior to login. The graphical configurator for &kdm; may still generate this section, but it is ignored by &kdm;.

### Locale

This section is handled by a standard KDE library. The only keys that are likely to have any effect are:

    Country
    Language
    Charset

A short description of the keys:

`Country`

  indicates the country. Look in `$KDEDIR/share/locale/l10n` for the complete list of country codes supported by your system. The country code is used to locate the file `$KDEDIR/share/locale/l10n/country_code/entry.desktop` which is used to provide locale-specific information such as time and date formats and the local currency symbol.

`Language`

  &kdm; で使用する言語を指定します。 (標準設定は: `C` で、 US English を表しています。) この値は環境変数 `KDE_LANG` で上書きできます。

`Charset`

  indicates the character set to use (default: `iso-8859-1`).

If you change the keys but all the dialogue text remains in English, this probably indicates that you do not have the translations installed on your system.

### Lilo

Lilo (Linux Loader) is a boot manager that is often used on GNU/Linux systems. Lilo comes with extensive documentation (see man lilo as a start). This section configures mechanisms for restarting the system using Lilo. The keys are:

    Lilo
    LiloCommand
    LiloMap

A short description of the keys:

`Lilo`

  Controls whether Lilo is used to restart the system (default: `FALSE`). When this key is set to `TRUE`, the "shutdown" dialogue box contains an extra drop-down configuration box next to the "restart" radio button. The drop-down allows you to select the kernel image that is to be used when rebooting the system. The list of images is created by querying the Lilo map file.

`LiloCommand`

  The location of the Lilo binary (default: `/sbin/lilo`).

`LiloMap`

  The location of the Lilo map file. The map file is maintained by Lilo and contains a list of kernels (versions of the operating system) to boot (default: `/boot/map`).

## Configuring your system to use &kdm;

This chapter assumes that your system is already configured to run the X Window System, and that you only need to reconfigure it to allow graphical login.

### &kdm; のセットアップ

The fundamental thing that controls whether your computer boots to a terminal prompt (console mode) or a graphical login prompt is the default runlevel. The runlevel is set by the program /sbin/init under the control of the configuration file `/etc/inittab`. The default runlevels used by different Unix systems (and different Linux distributions) vary, but if you look at `/etc/inittab` the start of it should be something like this:

    # Default runlevel. The runlevels used by RHS are:
    # 0 - halt (Do NOT set initdefault to this)
    # 1 - Single user mode
    # 2 - Multiuser, without NFS
    # 3 - Full multiuser mode
    # 4 - unused
    # 5 - X11
    # 6 - reboot (Do NOT set initdefault to this)

    id:3:initdefault:

All but the last line of this extract are comments. The comments show that runlevel 5 is used for X11 and that runlevel 3 is used for multi-user mode without X11 (console mode). The final line specifies that the default runlevel of the system is 3 (console mode). If your system currently uses graphical login (for example, using xdm) its default runlevel will match the runlevel specified for X11.

グラフィカル ログイン(xdm)でのランレベルは、いくつかの一般的な Linux ディストリビューションでは次の様になっています。

- 5 は Red Hat 3.x 以降および Mandrake の場合

- 4 は Slackware の場合

- 3 は S.u.S.E. 4.x と 5.x の場合

The first step in configuring your system is to ensure that you can start &kdm; from the command line. Once this is working, you can change your system configuration so that &kdm; starts automatically each time you reboot your system.

To test &kdm;, you must first bring your system to a runlevel that doesn't run xdm. To do so, issue a command like this:

    /sbin/init 3

Instead of the number "`3`" you should specify the appropriate runlevel for console mode on your system.

次に xdm を設定ディレクトリに置く必要があります; 通常そのディレクトリは `/etc/X11/xdm/` か `/usr/X11R6/lib/X11/xdm/` です。 その設定ディレクトリには `Xsetup_0` というファイルあります。 ソースコードから &kdm; をビルドしたとき、`configure` ステップでこのディレクトリが見付けられなければ、 &kdm; は `Xsetup_0` の 新しいバージョンを &kdm; のソースツリーにあるテンプレートファイルからインストールします。 `Xsetup_0` には次の一文を含めることができます。

    kdmdesktop

これで見栄えのよい背景(画像や背景色)が表示できます。 (これがまだ動作するか私は分かりませんが、あまり必要とはされていません。) もし `KDEDIR` が `/opt/kde` でない場合は、 `kdmdesktop` へのパスを変更する必要があるかもしれません。

If your system uses Pluggable Authentication Modules (PAM), which is normal with recent Red Hat and Mandrake systems, you should check that your PAM configuration permits login through the service named `xdm`. If you previously used xdm successfully, you should not need to make any changes to your PAM configuration in order to use &kdm;. `/etc/pam.conf` or `/etc/pam.d/xdm`. Information on configuring PAM is beyond the scope of this handbook, but PAM comes with comprehensive documentation (try looking in `/usr/doc/pam*/html`).

次のコマンドを発行して、 &kdm; のテストをしてみましょう:

    kdm -nodaemon

&kdm; のログイン ボックスが表示されログインすることができれば、うまくいっています。 ここでうまくいかない場合は、主にランタイム リンカが Qt あるいは KDE の共有ライブラリを見つけられないというときです。 KDE ライブラリをバイナリ配布でインストールしたのならば、 kde がインストールされているところ(通常は `/opt/kde/bin` ) に &kdm; もインストールされているかを確認して、KDE と Qt を指し示すための環境変数の設定してみて下さい。 例えば次のように。

    export KDEDIR=/opt/kde
    export QTDIR=/usr/lib/qt2
    export PATH=$KDEDIR/bin:$QTDIR/bin:$PATH
    export LD_LIBRARY_PATH=$KDEDIR/lib:$QTDIR/lib

それでもまだ成功しないのなら、代わりに xdm を起動してみて、 もっと深刻な X の設定の問題で何か障害がでていないかどうかを確かめて下さい。

&kdm; を起動に成功できるようになったら、 xdm を &kdm; で置き換えることに着手できます。 これもまた、ディストリビューション依存です。

- Redhat であれば、 `/etc/inittab` を編集します。 xdm という文字列を探して、これを &kdm; (全てのパスを含む) に置き換えて下さい。

- For Mandrake, the X11 runlevel in `/etc/inittab` invokes the shell script `/etc/X11/prefdm`, which is set up to select from amongst several display managers, including &kdm;. Make sure that all the paths are correct for your installation.

- S.u.S.E の場合、 `/sbin/init.d/xdm` ファイルを編集します。 以下の最初の 1 行を追加してください:

      . /etc/rc.config
      DISPLAYMANAGER=kdm
      export DISPLAYMANAGER

- その他ほとんどのディストリビューションはそれらのうちの一つの変種です。

`inittab`を変更するのがいやなら、 `xdm` を `xdm.bak` に名前を変えて、 &kdm; を `xdm` に シンボリックリンクをはることを選択肢とすることもできます。

At this stage, you can test &kdm; again by bringing your system to the runlevel that should now run &kdm;. To do so, issue a command like this:

    /sbin/init 5

Instead of the number "`5`" you should specify the appropriate runlevel for running X11 on your system.

The final step is to edit the `initdefault` entry in `/etc/inittab` to specify the appropriate runlevel for X11.

Before you make this change, ensure that you have a way to reboot your system if a problem occurs. This might be a "rescue" floppy-disk provided by your operating system distribution or a specially-designed "rescue" floppy-disk, such as `tomsrtbt`. Ignore this advice at your peril.

When you reboot your system, you should end up with the graphical &kdm; login box.

If this step is unsuccessful the most likely problem is that the environment used at boot time differs from the environment that you used for testing at the command line. Check files like `/etc/X11/xdm/Xsetup_0` (and any scripts that it invokes) to make sure that your path is not being changed without your knowledge. If you are trying to get two versions of KDE to co-exist, be particularly careful that the settings you use for your `PATH` and `LD_LIBRARY_PATH` environent variables are consistent, and that the startup scripts are not over-riding them in some way.

### Supporting multiple window managers

The main dialogue box for &kdm; includes a "session type" drop-down box, which allows you to select a window manager to use for your session. This chapter describes the changes that you must make to your configuration files in order to support this feature.

The options that appear in the "session type" drop-down box are configured by entries in the `KDM` section of `kdmrc`.

When you log in using &kdm;, the shell script `Xsession` is executed. The session type that you select is passed as a command-line argument. (`Xsession` can be found in `/etc/X11/xdm/` for Redhat and Mandrake, and in `/usr/X11R6/lib/X11/xdm/` for S.u.S.E.). Whilst debugging, you might find it helpful to add this line to `Xsession`:

    echo "$0 || $1 || $2" > $HOME/.Xsession_args

How you proceed now depends upon how your system usually starts up window managers. Here are two different approaches, with examples of the changes that you must make:

- The window manager is started by commands within `Xsession`. In this case, you can add a case statement to start the appropriate window manager. Linux Mandrake uses this approach; here is an extract from `Xsession`:

      # now, we see if xdm/gdm/kdm has asked for a specific environment
      case $# in
      1)
          case $1 in
              kde)
              source /opt/kde2/bin/kde1
              exec startkde
              ;;
              kde2)
              source /opt/kde2/bin/kde2
              exec startkde
              ;;
          	failsafe)
      	exec xterm -geometry 80x24-0-0
      	;;
      	default)
      	;;
      	*)
      	exec /bin/sh -c "$(/usr/sbin/chksession -x=$1)"
      	;;
           esac
      esac

- The window manager is started by another script that is invoked by `Xsession`. In this case you must ensure that the parameter passed to `Xsession` is passed on to that other script. For example, if the window manager is started like this:

      exec $startup

  you would need to change it to:

      exec $startup $@

  Having made this change, you must trace your way through the startup to find the place where the window manager is started. One approach uses `xinitrc` to start the window manager; this allows a system-wide file `/etc/X11/xinit/xinitrc` or a user-specific file `$HOME/.xinitrc` to be used. If you edit `$HOME/.xinitrc`, you may want to save a copy in `/etc/skel`, so that it will be automatically generated in every user account you create from now on. Here is an example `xinitrc` for a system using this approach:

      #!/bin/bash
      #
      # .xsession/.xinitrc
      #
      # choose a window manager
      #

      defaultwm=kde
      #set the window manager to $1 if it was supplied
      windowmgr=${1:-$defaultwm}

      #start the respective window managers
      case ${windowmgr} in
        kde|kwm|kdestart)
      	WINDOWMANAGER=startkde
      	;;
        fvwm|fvwm2)
      	WINDOWMANAGER=fvwm2
      	;;

        fvwm95)
      	WINDOWMANAGER=fvwm95
      	;;

        *)    WINDOWMANAGER=windowmgr   # default for unknown wm's

      esac

      #
      # load resources
      #

      if [ -f /usr/X11R6/lib/X11/Xmodmap ]; then
          xmodmap /usr/X11R6/lib/X11/Xmodmap
      fi

      if [ -f ~/.Xmodmap ]; then
          xmodmap ~/.Xmodmap
      fi

      if [ -f ~/.Xdefaults ]; then
          xrdb -merge ~/.Xdefaults
      fi

      if [ -f ~/.Xresources ]; then
          xrdb -merge ~/.Xresources
      fi
      #
      # finally start the window manager
      #
      exec $WINDOWMANAGER

## Building and Installing kdm

&kdm; is part of the KDE project. The various component parts of the KDE project are broken into sections, called packages. &kdm; is part of the package called kdebase. You can get KDE source code from various Linux and BSD distribution CDs, or by download from www.kde.org or its mirrors. If you have an out-of-date source code tree, you can use one of the KDE cvsup servers to bring it up-to-date whilst using minimal network bandwidth.

Before building kdebase, you must have built and installed (in this order) version 2 of the qt library and the KDE packages kde-qt-addon, kdesupport and kdelibs.

In order to build any of the above, you must already have the X Window System installed, together with a C++ compiler and the GNU configuration tools configure, automake and autoconf.

If the last few paragraphs seemed like a foreign language, then either you have strayed into an Inappropriate Area of this handbook, or you are about to undergo a Great Learning Experience.

If you managed to satisfy all of the prerequisites, you are unlikely to have any problems with building and installing kdebase. &kdm; is installed in your "`$KDEDIR/bin`" directory.

`make `install`` will overwrite your previous `kdmrc`.

## Other sources of information

Since &kdm; is descended from xdm, the xdm man page may provide useful background information. For X-related problems try the man pages X and startx. If you have questions about &kdm; that aren't answered by this handbook, take advantage of the fact the &kdm; is provided under the terms of the GNUgnu> Public License: look at the source code.

## クレジットと著作権

&kdm; は xdm をもとにし、 そのコードを含んでいます。

&kdm; 0.1 は Matthias Ettrich によって書かれました。 それ以降のバージョンはすべて Steffen Hansen によるものです。

xdm の著作権は (c) 1990, X Consortium にあります。

&kdm; のコードのその他の部分の著作権は作者と GNU GPL の 条件のもとにあります。 作者の名前を挙げることを条件に、誰でも &kdm; の改変と、その結果の再配布を許されています。

&kdm; には Qt ライブラリが必要ですが、これの著作権は Troll Tech AS が所有しています。

ドキュメント貢献者:

- ドキュメントは Steffen Hansen stefh@dit.ou.dk によって書かれました。

- ドキュメントは Gregor Zumsteinzumstein@ssd.ethz.ch によって拡張されました。 最終更新は 1998/07/09 です。

- ドキュメントは Neal Crooknac@forth.org によって KDE2 のために校正されました。 最終更新は 2000/07/06 です。

ドキュメントの著作権は Steffen Hansen、 Gregor Zumstein、 Neal Crook にあります。

&underFDL; &underGPL;