12

I am running Debian Jessie which uses SystemD. I have so far been unable to find a way to stop X11 from starting on bootup. The raspi-config setting apparently does not do anything.

Can anyone help?

John Smith
  • 1,251
  • 3
  • 17
  • 27
  • Are you using systemd w/ jessie? – goldilocks May 11 '15 at 16:15
  • @goldilocks : systemd came free with jessie. I didn't specifically request it. – John Smith May 11 '15 at 16:16
  • All apologies -- I did not notice you mentioned systemd in the original question. – goldilocks May 11 '15 at 20:30
  • I just created a new SD card from the latest image ("2015-11-21" at the time) from the Raspberry Pi site. Modifying the 3 Boot Options setting in raspi-config to B1 Console worked fine for me on next reboot. They may have fixed an issue. – patridge Dec 08 '15 at 15:31

4 Answers4

18

Systemd users "service bunlde" named target, to achieve different system states while booting the system. You need to change the desired state of the system, from graphical to multi-user.

Run

systemctl get-default

Will show you

graphical.target

You could change it with

sudo systemctl set-default multi-user.target

I could recommend this article to understand how to work with systemd https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

singer
  • 281
  • 2
  • 3
2

The GUI login is lightdm (the dm is for display manager). This is started as an init service, and the init system on Jessie is systemd.

I believe the name of the service is also "lightdm". You can confirm that:

systemctl list-units | grep lightdm

The middle columns should say "loaded active" and the first one "lightdm.service". Presuming that's it, to disable on boot:

sudo systemctl disable lightdm
goldilocks
  • 58,859
  • 17
  • 112
  • 227
  • 1
    I have tried it, and lightdm still comes up on reboot. – John Smith May 11 '15 at 21:51
  • Go figure. Try update-rc.d lightdm disable as well; I haven't had much of a look at whatever transitional mess is involved in Debian switching to systemd. If all that doesn't work just uninstall the whole thing (apt-get remove lightdm), and if that doesn't work give up -- your system is haunted ;) – goldilocks May 12 '15 at 08:38
  • I even tried systemctl mask, and it still brings back lighted. Also I tried "systemctl disable graphical", and it also fails. I believe my machine is haunted. – John Smith May 12 '15 at 23:58
  • If you've tried both update-rc.d disable and systemctl disable, at this point it shouldn't be considered anything other than a screw-up by the Raspbian crew and you should report it as such (https://www.raspbian.org/RaspbianBugs). I have an upgraded-to-jessie pi, but lightdm was removed before the upgrade; there is no reason a GUI login should be inescapable on any GNU/Linux system. The easy way for you, if you don't care, should be just the apt-get remove; doing a bug report is more tedious, but if you are up to it, remember to give them a link to here in the report. – goldilocks May 13 '15 at 00:43
2

This worked on my Raspbian/Jessie:

sudo systemctl set-default multi-user.target

I can still manually start lightdm via

sudo service lightdm start

or

sudo lightdm
user35963
  • 21
  • 1
0

The Debian way to enable or disable services is to use update-rc.d. You can use

update-rc.d lightdm disable

if in fact lightdm is the display manager installed.

If you need to run it once, you can

service lightdm start

update the systemd way to do it is in fact to use systemctl disable like indicated in the other answer

daks
  • 113
  • 6
  • "The Debian way" here is their twist/tweak on the SysV init way of doing things. Debian used SysV for ~20 years, up until Jessie, and the default is now systemd.
    They have (apparently) added functionality to update-rc.d to make it work with systemd for people used to doing it the old way, but if this is all new to you, you might as well learn the new way -- SysV is now pretty much dead on linux.
    – goldilocks May 11 '15 at 19:41
  • As you say it, update-rc still works with systemd so why not use it? Debian, as other distributions, has a lot of scripts to manage the system, I don't see a reason to not use them. But I'm willing to learn the systemd way of doing it if you know it. – daks May 11 '15 at 19:58
  • hum maybe the 'systemctl disable lightdm' you indicated in the answer is this way. I read it quickly and thought it was a command to disable it once and not forever. – daks May 11 '15 at 20:01
  • It's the same as sysv that way, there's stop and disable. WRT how you do it, if there's a way you are familiar and comfortable with that works then there's no harm in sticking with it (at least for a while), but if you are new to all this init service stuff (I'm presuming the OP is), then it would be a bit silly to start learning depreciated methodologies. – goldilocks May 11 '15 at 20:08