Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup

From ArchWiki

Jump to: navigation, search


i18n
English
Deutsch
עברית
Русский
简体中文

Contents

[edit] Introduction

It is very easy to add a Display Manager, also known as a Login Manager. You have two easy methods to accomplish this:


1. Daemon Method

The Display Manager will load automatically during the start-up as a daemon.

( Currently only works with Entrance, GDM, KDM and SLiM )


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


1. Change to Super User Mode.


 $ su


2. Open the file /etc/rc.conf in your editor of choice.


 # emacs /etc/rc.conf
 # nano /etc/rc.conf
 # vi /etc/rc.conf


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


4. Append the daemon name for the Display Manager of your choice ( 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. 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

1. Change to Super User Mode.


 $ su


2. Open /etc/inittab using an editor of your choice.


 # emacs /etc/inittab
 # nano /etc/inittab
 # vi /etc/inittab


3. Find the line that looks like this:


id:3:initdefault:


4. Modify the '3' to '5' for X11:


id:5:initdefault:


5. Save the file and exit the editor. The next time you reboot, the Display Manager should run.

[edit] Modify default Display Manager

1. Change to Super User Mode.


 $ su


2. Open /etc/inittab using an editor of your choice.


 # emacs /etc/inittab
 # nano /etc/inittab
 # vi /etc/inittab


3. Find the line that looks like similar to this one ( near the end ):


x:5:respawn:/usr/bin/xdm -nodaemon


4. Modify it so it points to the Display Manager of your choice:

[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. 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 with out 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,


1. Change to Super User Mode.


 $ su


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


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

[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

[edit] See Also

Personal tools