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.
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.