Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup
From ArchWiki
| i18n |
|---|
| English |
| Deutsch |
| עברית |
| Русский |
| 简体中文 |
Contents |
[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:
- Inittab Method
The Display Manager will load automatically after start-up and will respawn in the event of a crash. - Daemon Method
The Display Manager will load automatically during the start-up as a daemon.
(Currently only works with Entrance, GDM, KDM and SLiM)
The inittab method is the recommended one for various reasons, one being that it will allow you to boot directly into framebuffer mode from GRUB which is an advantage should the graphics driver crash in X, for example, and you will have to fix your system from a live cd or trough other needlessly complex means.
With the inittab method all you would have to do is to press 'e' for edit at the GRUB prompt and just add:
3
to the end of the 'kernel' line to boot directly into framebuffer mode in order to fix your system/X(This is also described more thoroughly & descriptive below.)
Both methods are equally easy.
[edit] Inittab Method
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
Change to Super User Mode:
$ su
Edit /etc/inittab using an editor of your choice:
# emacs /etc/inittab # nano /etc/inittab # vi /etc/inittab
Find the line that looks like this:
id:3:initdefault:
Modify the '3' to '5' for X11:
id:5:initdefault:
Save the file and exit the editor. The next time you reboot, the 'X Display Manager' should run. For other display managers see below:
[edit] Modify default Display Manager
Change to Super User Mode:
$ su
Edit /etc/inittab using an editor of your choice:
# emacs /etc/inittab # nano /etc/inittab # vi /etc/inittab
Find the line that looks like similar to this one (near the end):
x:5:respawn:/usr/bin/xdm -nodaemon
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
Save the file and exit the editor. The next time you reboot, the Display Manager of your choice should run.
[edit] Daemon Method
You simply need to add the daemon name to your daemons array in '/etc/rc.conf'.
Change to Super User Mode:
$ su
Edit /etc/rc.conf in your editor of choice:
# emacs /etc/rc.conf # nano /etc/rc.conf # vi /etc/rc.conf
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
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)
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] 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,
Change to Super User Mode:
$ su
Edit /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
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