Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup
From ArchWiki
| i18n |
|---|
| English |
| Deutsch |
| עברית |
| Русский |
| 简体中文 |
[edit] Install the package
Entrance:
pacman -Sy entrance-svn (note: entrance-svn is in the [community] repository)
GDM:
pacman -Sy gdm
KDM:
pacman -Sy kdebase
SLiM:
pacman -Sy slim
XDM:
pacman -Sy xorg-xdm
[edit] Configure loading the Display Manager
You have two easy methods to make the system load the display manager:
- Daemon Method
The Display Manager will load automatically during the start-up as a daemon.
(Currently only works with Entrance, GDM, KDM and SLiM) - Inittab Method
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] Daemon Method
You simply need to add the daemon name to your daemons array in '/etc/rc.conf'.
[edit] Change to Super User Mode
$ su
[edit] Open the file /etc/rc.conf in your editor of choice
# emacs /etc/rc.conf # nano /etc/rc.conf # vi /etc/rc.conf
[edit] Near the end of the file you will see a line that looks similar to the following:
DAEMONS=(syslogd klogd !pcmcia network netfs crond) # this is the daemons array
[edit] Append the daemon name for the Display Manager of your choice (entrance, gdm, kdm or slim)
Entrance:
DAEMONS=(syslogd klogd !pcmcia network netfs crond entranced)
GDM:
DAEMONS=(syslogd klogd !pcmcia network netfs crond gdm)
KDM:
DAEMONS=(syslogd klogd !pcmcia network netfs crond kdm)
SLiM:
DAEMONS=(syslogd klogd !pcmcia network netfs crond slim)
[edit] Save the file and exit the editor
The next time you reboot, the Display Manager should run. In the event that it doesn't, make sure that you typed in the name correctly, also make sure that the manager you selected is installed. It also helps to make sure that startx is not stopping with errors.
[edit] Inittab Method
While the above method will work, you will be underusing the great run-level system GNU has.
The run-levels are:
0 Halt 1(S) Single-user 2 Not used 3 Multi-user 4 Not used 5 X11 6 Reboot
Arch's default run-level is 3 and XDM as its Display Manager.
[edit] Modify default run-level
[edit] Change to Super User Mode.
$ su
[edit] Open /etc/inittab using an editor of your choice.
# emacs /etc/inittab # nano /etc/inittab # vi /etc/inittab
[edit] Find the line that looks like this:
id:3:initdefault:
[edit] Modify the '3' to '5' for X11:
id:5:initdefault:
[edit] Save the file and exit the editor. The next time you reboot, the Display Manager should run.
[edit] Modify default Display Manager
[edit] Change to Super User Mode.
$ su
[edit] Open /etc/inittab using an editor of your choice.
# emacs /etc/inittab # nano /etc/inittab # vi /etc/inittab
[edit] Find the line that looks like similar to this one (near the end):
x:5:respawn:/usr/bin/xdm -nodaemon
[edit] Modify it so it points to the Display Manager of your choice:
Entrance:
x:5:respawn:/usr/sbin/entranced -nodaemon >& /dev/null
GDM:
x:5:respawn:/usr/sbin/gdm -nodaemon
KDM:
x:5:respawn:/usr/bin/kdm -nodaemon
SLiM:
x:5:respawn:/usr/bin/slim &> /dev/null
[edit] Save the file and exit the editor. The next time you reboot, the Display Manager of your choice should run.
[edit] Switching run-levels
If you want to test out the display manager without rebooting, or you want to change the X configuration and that pesky Display Manager keeps respawning.
Use this command:
/sbin/telinit <run-level>
To switch to run-level 3 (Multi-User):
/sbin/telinit 3
To switch to run-level 5 (X11):
/sbin/telinit 5
By switching you can avoid restarting the system during your testing.
[edit] GRUB
You can add a menu item in GRUB to allow you to boot with or without X11,
[edit] Change to Super User Mode.
$ su
[edit] Open /boot/grub/menu.lst using an editor of your choice.
# emacs /boot/grub/menu.lst # nano /boot/grub/menu.lst # vi /boot/grub/menu.lst
[edit] Find the first kernel entry you have, the default is '# (0) Arch Linux'
# (0) Arch Linux title Arch Linux root (hd0,0) kernel /vmlinuz26 root=/dev/sda3 ro initrd /kernel26.img
You can duplicate it and modify both like so:
# (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
The run-level was appended to the end so the kernel knows what run-level to start with.
[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