To Hell with Login Managers! by eokuwwy


System Info

Recently, I upgraded from Debian Squeeze (stable) to Debian Sid (unstable). After much tinkering and heavy kerwankery, I’ve decided that I’m very happy with my choice. It was not so in the beginning though. One of the biggest hurdles I had to overcome was the login manager.

Before upgrading to sid, gdm was my login manager, and it was fine. The speed was decent enough, and I really had no complaints about it. I certainly never felt the need to mess with it or to replace it. That all changed when I upgraded to sid and all of my gnome utilities/libraries were updated to version 3.×. This meant that I had to “upgrade” to gdm3. What a piece of crap. It’s slow as hell, ridiculously slow. Using bootchart2, I was able to see just how bad it is. Behold the following stats (Cumulative I/O usage):

Using a stopwatch, it takes at a minimum 30 seconds for the login screen to load AND to be ready for user input. I’m talking about the time it takes from when the x-server first starts up (and with gdm3 you see a blank screen at first with the wait cursor), to when you are actually allowed to enter your username and password. The wait time is much longer than the former bloated-by-Dell Windows 7 install on the same machine. Totally unacceptable HORSE MANURE.

I tried KDM and it was a bit faster, and functionally, it was fine. But still pretty slow overall. I then moved to SLIM, and while that was faster than the other login managers, I found that I couldn’t Restart, Shutdown, Suspend, or Hibernate from my xfce session. Also, many devices wouldn’t auto-mount, such as the iPod. Googling this problem led to results, mostly from the Ubuntu forums, in which people stated that this was simply a limitation of SLIM (and other lightweight login managers), and the only solution was to use GDM or KDM. I neglected to dig further, and decided to just use GDM3 for the time being. I had, after all, a lot of other tinkering to do with my system since the upgrade to sid.

Eventually, I came to a point where I was mostly satisfied with my new setup, and I turned back to the login manager. I found a page in the Arch Wiki (imagine that!) regarding SLiM configuration. The key missing ingredient is pointed out on the Arch Wiki here (referring to ~/.xinitrc):
To get automount to work it might be necessary to use something like e.g

exec ck-launch-session dbus-launch startxfce4


I purged gdm3 (and kdm for good measure), re-installed slim, and made sure that it was selected as the display manager. After rebooting, slim failed to start for some reason. So I had to login to the shell. I did so, and typed “startx”. All of the problems I cited previously were gone, because of having “ck-launch-session dbus-launch” in my .xinitrc. It’s all related to policykit and consolekit (I have both installed) and permissions that the x session has. The reason Restart, Shutdown, etc. were disabled is because the x session did not have permission to execute them. The same was true for auto-mounting devices.

So, why bother with a login manager at all? Any graphical login manager will be slower than logging into the shell. Also, there may be times when you don’t want to run x at all. So to hell with all login managers I say! I purged SLIM. Now my overall startup time is much faster, and I don’t have to worry about any extra issues that can be caused by a login manager. (GDM3 once crashed in the middle of a session, and I had to power down manually) Below are the details of what I did.

Purge all the login managers I ever had installed, just to make sure they are completely gone.


sudo aptitude purge gdm3 gdm kdm slim

I initially didn’t have an ~/.xinitrc file, so I had to create one. Then, as the Arch Wiki points out, it’s essential to make it executable.

chmod +x ~/.xinitrc

Here is my entire .xinitrc file.

#!/bin/sh

#

  1. ~/.xinitrc
    #
  2. Executed by startx (run your window manager from here)
    #

exec ck-launch-session dbus-launch startxfce4



After that, it was just a matter of rebooting, logging into the shell, and typing startx. Now everything “just works” and I’m pretty damn happy. I’m so happy that I will say Merry Christmas instead of Happy Holidays, and not worry about the consequences of offending anyone. So, Merry Christmas to you all!

blog comments powered by Disqus