no1453
Posts: 7
Joined: Sat Jul 13, 2013 10:30 pm

help? Cannot get rpi to boot to console, only X

Mon Dec 15, 2014 7:26 am

Hello! I'm at the end of my rope trying to get my pi to boot to console by default.

I made a system using raspbian-ua-netinst-v1.0.5, if you are familiar with it, I just added the option "release=jessie" to the config file, to use testing instead of wheezy.

I did this to try and compile MAME and advancemame, which kept pooping out with compiler bugs on raspbian wheezy. I finally got advancemame to compile, and I wanted to test it in console mode... and there my trouble started.

I cannot get the damn thing to boot to console instead of X. If lightdm is installed, it starts up no matter what I've tried.
Using raspi-config to change boot options did not work. It warns me that the default LSB runlevels are being overridden to what I want , all good there, but you boot up, and there comes "Starting Light Display Manager".

I tried using sysv-rc-conf to disable lightdm at all runlevels. No success.
I tried using update-rc.d to do the same thing. No success.

I even executed

Code: Select all

update-rc.d -f lightdm remove
, but it still starts up, even when it is not listed in any of the /etc/rcX.d directories.

I tried modifying

Code: Select all

/etc/init.d/lightdm
and adding code that should prevent it from starting if an environment variable is not set. The environment variable is not set, but lightdm still starts right up at boot.

There must be something I'm missing here. Any ideas? The only clue I have is the console messages involving "Starting LSB: ..."; perhaps it's using the default LSB values instead of the ones specified?

thanks for any info on this. :D

alwanbi
Posts: 17
Joined: Mon Oct 06, 2014 12:34 am
Contact: Website

Re: help? Cannot get rpi to boot to console, only X

Tue Dec 16, 2014 10:20 pm

I am not familiar with lightdm, but I will try to help you out.
Open up a terminal in X and type: sudo ps -A | grep lightdm
That should tell you what the pid number is for lightdm
Example: 3319 - lightdm
I am at work so I don't have access to my linux box so my example probably does not look exactly correct, but hopefully you will understand.

Next type: sudo kill -9 3319

that will kill the lightdm program and you should be back at your main console prompt

Now make sure you are in your home directory:
$ cd
$ pwd
$ nano .xinitrc

#exec lightdm
make the line above a remark statement, save the file and exit.

Reboot your pi and see if your pi will boot straight to the command prompt.

Note: It is best to always run raspi-config right away when you install any version of raspbian.

I hope this helps
Alan Jones

no1453
Posts: 7
Joined: Sat Jul 13, 2013 10:30 pm

Re: help? Cannot get rpi to boot to console, only X

Tue Dec 16, 2014 10:58 pm

My account didn't have an .xinitc, and the global one at /etc/X11/xinit/ doesn't seem to be able to interrupt the startup (by modifying it). So I'm looking around at the global Xsession and such.

Thanks for the suggestions; it gave me ideas on where else to look in the boot chain (which I am learning a great deal about in trying to solve this :D ) So at least I don't feel stuck on this issue anymore.


EDIT: found out my default session manager (following /usr/bin/x-session-manager synlinks) was "gnome-session". (without gdm3 installed!) So I think I found the problem, I'm running "update-alternatives --config x-session-manager" and it let's me choose LXDE (which is what I thought I was using ??? ). I'll post another edit if it works.

alwanbi
Posts: 17
Joined: Mon Oct 06, 2014 12:34 am
Contact: Website

Re: help? Cannot get rpi to boot to console, only X

Wed Dec 17, 2014 6:02 am

Ok, glad to hear you are making some progress.
Alan Jones

no1453
Posts: 7
Joined: Sat Jul 13, 2013 10:30 pm

Re: help? Cannot get rpi to boot to console, only X

Sun Dec 21, 2014 1:45 am

I was able to solve my problem by uninstalling X (along with gnome* and lxde*) and then reinstalling it, and creating an ~/.xinitrc that just has the line "openbox-session" (and of course a terminal and clock and such listed in ~/.xsession).

I still see a number of messages along the line of "Starting LSB: starting (service): ..." So it looks like my installation is (I think) starting services at their default runlevels regardless of the contents of the /etc/init.d and /etc/rcX.d directories. Which seems like a really odd behavior. As soon as I can find out how to stop "Staring LSB: (sevice)..." I'll post the solution.

no1453
Posts: 7
Joined: Sat Jul 13, 2013 10:30 pm

Re: help? Cannot get rpi to boot to console, only X

Sun Dec 21, 2014 2:13 am

Houston, we've found the problem. I found a web page that informed me that release "jessie" no longer uses "init" and the init.d and rcX.d scripts, it has moved on to using "systemd" for boot. From the Wiki article (http://en.wikipedia.org/wiki/Systemd:

"As an integrated software suite, systemd replaces the traditional init daemon and startup scripts, and also integrates many other services that are common on Linux systems, such as user logins, handling of the system console, device and hot plugging management (replacing udev), hostname and locale handling, scheduled execution (replacing cron), and a unified system for logging various events. Systemd executes elements of its startup sequence in parallel, which is faster than the traditional startup sequence's sequential approach."

alwanbi
Posts: 17
Joined: Mon Oct 06, 2014 12:34 am
Contact: Website

Re: help? Cannot get rpi to boot to console, only X

Sun Dec 21, 2014 2:24 am

Congrats on finding the problem.
I forgot that you were using Raspbian Jessie.
I quit using Raspbian because of systemd.
Good luck on your future endeavors!
Alan Jones

User avatar
rpdom
Posts: 19033
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: help? Cannot get rpi to boot to console, only X

Sun Dec 21, 2014 7:58 am

You can switch back to the old init system by installing sysvinit-core. Most of systemd will be removed (a few libraries and things will remain, but it won't be running your OS any more).

alwanbi
Posts: 17
Joined: Mon Oct 06, 2014 12:34 am
Contact: Website

Re: help? Cannot get rpi to boot to console, only X

Sun Dec 21, 2014 4:08 pm

rpdom,
Thanks for that info, I remember reading somewhere about how to turn systemd off in raspbian but forgot to book mark it.
Alan Jones

no1453
Posts: 7
Joined: Sat Jul 13, 2013 10:30 pm

Re: help? Cannot get rpi to boot to console, only X

Sun Dec 21, 2014 4:13 pm

Yes, that is good to know. (Now I have to decide whether to learn how systemd works, or replace it :)

User avatar
rpdom
Posts: 19033
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: help? Cannot get rpi to boot to console, only X

Sun Dec 21, 2014 4:43 pm

no1453 wrote:Yes, that is good to know. (Now I have to decide whether to learn how systemd works, or replace it :)
I'm intending to learn how systemd works and switch to it properly. But in my own time. There's too much to learn to switch suddenly.

Return to “Troubleshooting”