在启动时自动启动一个登录管理器(KDM, GDM, or XDM)
From ArchWiki
| i18n |
|---|
| English |
| Deutsch |
| עברית |
| Русский |
| 简体中文 |
Contents |
[edit] 介绍
添加一个显示管理器非常容易(也叫登录管理器)。你有两个简单方法来完成:
1. 服务模式
显示管理器将在加载为服务后自动运行。
( 目前能这样工作的只有 Entrance, GDM, KDM and SLiM )
2. Inittab 方式
The Display Manager will load automatically after start-up and will respawn in the event of a crash.
My personal favorite --thewonka 21:40, 26 February 2007 (EST)
[edit] 服务模式
只需要简单添加服务到'/etc/rc.conf'的daemons一行。
1. 更改用户成root
$ su
2. 在你喜欢的编辑器里打开 /etc/rc.conf 。
# emacs /etc/rc.conf # nano /etc/rc.conf # vi /etc/rc.conf
3. 在rc.conf文件结尾你将会看到类似下面的一行:
DAEMONS=(syslogd klogd !pcmcia network netfs crond) # this is the daemons array
4. 添加一个服务名称( entrance, gdm, kdm or slim )
[edit] Entrance
DAEMONS=(syslogd klogd !pcmcia network netfs crond entranced)
[edit] GDM
DAEMONS=(syslogd klogd !pcmcia network netfs crond gdm)
[edit] KDM
DAEMONS=(syslogd klogd !pcmcia network netfs crond kdm)
[edit] SLiM
DAEMONS=(syslogd klogd !pcmcia network netfs crond slim)
5. 保存然后退出编辑器。下一次重启,显示管理器将会自动运行。如果发现没有工作,先检查你输入的名称是否正确,然后检查你选择的显示管理器已经被安装。可能也需要使用startx来看你的X是否正常而不是以某些错误结束。
[edit] Inittab方式
当GNU的很有用的运行等级(run-devel)使用时,此方式将会工作。
这些运行等级有:
0 Halt 1(S) Single-user 2 Not used 3 Multi-user 4 Not used 5 X11 6 Reboot
Arch默认的运行等级是3,显示管理器是XDM。
[edit] 修改默认运行等级
1. 切换用户到root.
$ su
2. 使用你喜欢的编辑器编辑/etc/inittab:
# emacs /etc/inittab # nano /etc/inittab # vi /etc/inittab
3. 找到如下这一行:
id:3:initdefault:
4. 为了启动X11需要把'3'修改成'5':
id:5:initdefault:
5. Save the file and exit the editor. The next time you reboot, the Display Manager should run.
[edit] 修改默认显示管理器
1. 同样使用root帐户。
$ su
2. 使用你喜欢的编辑器编辑/etc/inittab。
# emacs /etc/inittab # nano /etc/inittab # vi /etc/inittab
3. 找到类似如下这一行(在接近文件尾部
x:5:respawn:/usr/bin/xdm -nodaemon
4. 根据你的不同情况修改:
[edit] Entrance
x:5:respawn:/usr/sbin/entranced -nodaemon >& /dev/null
[edit] GDM
x:5:respawn:/usr/sbin/gdm -nodaemon
[edit] KDM
x:5:respawn:/opt/kde/bin/kdm -nodaemon
[edit] SLiM
x:5:respawn:/usr/bin/slim &> /dev/null
5. 保存然后退出编辑器。下一次你重启,你选择的显示管理器就会运行了。
[edit] 选择运行等级
如果你想测试一下你的显示管理器,而不想重启,或者你想修改X配置因为讨厌的显示管理器不断重启。
使用下列命令:
/sbin/telinit <run-level>
例如修改run-level为3 ( Multi-User ):
/sbin/telinit 3
修改成 run-level 5 ( X11 ):
/sbin/telinit 5
这样选择你可以测试而避免重启。
[edit] GRUB
你可以添加一个菜单条目到GRUB来允许X11在系统启动时运行或者不运行:
1. 切换用户到root。
$ su
2. 用你喜欢的编辑器编辑/boot/grub/menu.lst。
# emacs /boot/grub/menu.lst # nano /boot/grub/menu.lst # vi /boot/grub/menu.lst
3. 根据已经有的条目修改,如'# (0) Arch Linux'
# (0) Arch Linux title Arch Linux root (hd0,0) kernel /vmlinuz26 root=/dev/sda3 ro initrd /kernel26.img
你可以复制,或者修改成如下:
# (0) Arch Linux Multi-user title Arch Linux Multi-user root (hd0,0) kernel /vmlinuz26 root=/dev/sda3 ro 3 initrd /kernel26.img
# (0) Arch Linux X11 title Arch Linux X11 root (hd0,0) kernel /vmlinuz26 root=/dev/sda3 ro 5 initrd /kernel26.img
那样修改运行等级,就可以让内核知道启动时使用什么运行等级了。
[edit] LILO
You can start-up with the run-level of your choice by just selecting or typing in the kernel name and then appending the desired run-level in the lilo boot screen.
Like so:
: Arch 5
[edit] Packages
Entrance
pacman -Sy entrance-cvs (note: entrance-cvs is in the [community] repository)
GDM
pacman -Sy gdm
KDM
pacman -Sy kdebase
SLiM
pacman -Sy slim
XDM
pacman -Sy xorg-xdm