startx autologin does not run in /etc/inittab in after Debian Jessie update

9,162

Solution 1

You only have the permission to start an X session with startx if you're logged in on a console. Remote users (for example) don't get this permission. When you run /bin/su -c /usr/bin/startx -l bateman from /etc/inittab, you don't get a console so starting the X server fails.

The normal way to get a GUI at run time is to run a display manager. A display manager starts an X server and shows a login prompt in graphical mode. On Debian wheezy, you get a choice of gdm3 (Gnome look and feel), kdm (KDE look and feel), lightdm (modern, DE-independent), slim (lightweight, configurable), wdm (WindowMaker look and feel) and xdm (old-timey, Athena look and feel). What you use as the display manager is independent of what graphical environment you use after logging in: the display manager choice is up to the system administrators, and users can each use their preferred environment after logging in.

If you don't want to have to log in on the console because your computer is in a room that only you can enter, several display managers let you set up autologin. For example, with LightDM, edit /etc/lightdm/lightdm.conf and uncomment the line autologin-user= and add your username after the equal sign.

Solution 2

systemd is not backwards compatible with System 5 init, only System 5 rc.

You've switched from Debian 7 to the prospective Debian 8. This has, probably unbeknownst to you, switched your system management from (Linux) System 5 init+rc to systemd. systemd is the default init system, and that particular upgrade performs this switch.

Linux System 5-style system management comprises two parts, init which runs as process #1 and rc which is in charge of running start and stop scripts. These are actually from two distinct packages in Debian. init is from the sysvinit package and rc is usually from the sysv-rc package. (There are alternative rc programs that can be used with System 5 init, in the file-rc and openrc packages.)

/etc/inittab is a configuration file processed by init. systemd does not provide any backwards compatibility mechanism for this. systemd's System 5 backwards compatibility mechanism is only for System 5 rc, which runs the programs in /etc/init.d/. (systemd implements no backwards compatibility mechanism for file-rc's and openrc's configuration mechanisms, either.)

This is not something that is specific to systemd. Pretty much no replacement init/system manager — from Felix von Leitner's minit through initNG and upstart to the system-manager in nosh — processes /etc/inittab. About the only one that looks at /etc/inittab is Nikola Vladov's ninit.

To plumb a service in to systemd, you must use the mechanisms that it does support, namely its own service unit files and the System 5 rc configuration files in /etc/init.d/. How to run startx as a systemd service is a different question, of course.

Further reading

Share:
9,162

Related videos on Youtube

GKFX
Author by

GKFX

Biology student & hobby Java programmer.

Updated on September 18, 2022

Comments

  • GKFX
    GKFX over 1 year

    I installed a minimal Debian system (stable) without GUI, switched to testing/jessie to be able to get the Cinnamon desktop, but X didn't start on boot. If I log in as myself at the CLI, I can type startx to launch the GUI, and I don't have any problems. So, I added the following to /etc/inittab:

    # The default runlevel.
    id:5:initdefault:
    
    # ...
    
    sx:45:once:/bin/su -c /usr/bin/startx -l bateman
    

    This has no effect whatsoever. Why not? More importantly, how do I make it work, without installing any more software?

    Edit

    It looks like my /etc/inittab doesn't do anything at all. Changing

    1:2345:respawn:/sbin/getty 38400 tty1
    

    to

    1:2345:respawn:/sbin/getty -a bateman 38400 tty1
    

    does not autologin (even after creating and adding myself to the group autologin) (a wild stab from here), and commenting out

    3:2345:respawn:/sbin/getty 38400 tty3
    

    does not disable tty3. What is going on?

    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' about 9 years
      If you want to do something with /etc/inittab (which is not necessary nor particularly useful for your initial question), you need to tell us whether your system is using systemd (the jessie default) or sysvinit. If you're using systemd, some or all of inittab may not be used — inittab it the configuration file for sysvinit.
  • GKFX
    GKFX about 9 years
    I've unmarked this as the answer because it doesn't seem to solve the main problem (and nodm didn't work properly). See update to question.
  • GKFX
    GKFX about 9 years
    OK, I've got LightDM working now. To be honest, the main reason I came here was because I was baffled by /etc/inittab not doing anything; your comment about systemd clears that up nicely. The problem with NoDM, if you're interested, was something permissions-related which meant I had to type my password into a gksu prompt to shutdown the computer. It's still annoying that I need to install a package to do the equivalent of typing startx, but that's life. Thank you very much for your help.
  • GKFX
    GKFX about 9 years
    Thank you for this. I got the gist of the issue from Gilles' brief comment on it, but thank you for explaining it in more detail.