OSMC hangs on boot – how to troubleshoot?

Hi there,

OSMC was working great, but then after installing some packages it hangs indefinitely on boot. This is the last line that it gets to:

Starting NTP server: ntpd.

By this point SSH hasn’t come up so I can’t use that to work out what’s going on – and no matter what keys I press on the keyboard I can’t get to a prompt.

Any ideas?

same problem here. for me it was the nginx package that broke the system. is there a safe mode that could be activated on boot?

if there is no solution for this kind of problem all my work of configuring would be lost …

update: i have a vague idea for a possible fix. is it possible to modify the start file on the boot partition of the sd-card in a way that the rc.local services are prevented from being started?

i have no possibility to test this right now and further i doubt i would have the linux skills to rewrite the startup script for this purpose. help anybody?

ok i have a solution:

enter the sd-card in your pc and open the boot partition. add the line “init=/bin/bash” to the file cmdline.txt in the root directory. now start up the pi again with the sd-card. now, you should be able to get a ssh connection and fix the problem by apt-get removing all the packages that could have caused your problems.

@osm-staff: thx for not helping at all with this problem. i really am a bit disappointed i have to admit. as a not very expierienced linux-user i guess this is quite a basic problem if even i was able to figure that out (after a week of hoping for answers).

We are working on a hot key that will invoke the shell when pressed during boot up.

This will indeed bring you to a shell.

We are extremely busy, and we assume that those familiar with Debian’s apt-get system will be able to resolve issues, or at the very least provide the relevant information to debug the issue. Further to this: if you are running a web server you should be familiar with the underlying operating system for security, performance and stability purposes

Your ‘basic problem’ has yet to be resolved: you have merely removed nginx from your system. My guess would be that nginx does not handle the problem when binding to port 80 gracefully (Kodi takes this by default and you should change the port number there in Settings first), and thus hangs. Without any logging whatsoever, I am unable to determine the root cause of your problem.

Further to this: there are a number of use case scenarios that we have never tried and will never be able to try due to time constraints.

Would be interested in the actual cause of the problem so at the very least we can document it for other users and ideally, resolve it.

S

Thanks for your reply, Sam.

Evidently I’m not as mad about this as bendsch, but I’ll admit I did find it frustrating when I ran into an issue simply from installing a package from APT and then not being able to find any way to get to a prompt to troubleshoot it. (I ended up re-imaging my SD card and starting again.)

So, consider this a +1 for having a hotkey that brings the user to a shell during boot :smile:

Thanks for all your hard work.

I have a few ideas for how to implement boot time recovery hotkeys - will see if we can get this done by the next release or final release, because I agree that something is needed.

to clarify: i am not mad at anyone, but i really was a bit disappointed about not even getting a single answer after a week. further i cared enough for the forum to post my solution here.

a shortcut at startup would be great. what i figured out is that appending the line “init=/bin/bash” to the cmdline.txt wont affect the start of osmc at all. so one could just leave that line in the file for safety just to make sure there is a console reachable through ssh in case of a problem.

cheers, bendsch.

Fair point but as Sam said earlier we are very busy working on actually developing OSMC and with real life limiting the amount of time that we can spend on OSMC (I’m renovating a house for example, and Sam is finishing a degree, and I know the other devs are quite busy too) that often doesn’t leave much time for the forum, so we do rely to a degree on users supporting other users, which is the way things work in most good forums.

It also depends on the nature of the problem - for example if its something I know the answer to off hand I will generally find time to reply, but some problems can’t be investigated or solved without trying to duplicate the issue first hand - and if that means installing some random 3rd party software that is causing the issue (which I have never heard of before, don’t know how to use or don’t have the hardware to use) then more often than not there just isn’t the time to do that. (This time would take away from actually developing OSMC)

Although OSMC is effectively an open source Debian derivative which allows you to install pretty much whatever you want to on it, that doesn’t mean that we are able to provide what amounts to Linux consulting services for any and all random 3rd party applications to make sure they are working - we just can’t physically do that.

Obviously there are some programs that are frequently used in conjunction with Kodi such as tvheadend that we will try our best to get working, or if the issue seems to be a significant underlying issue in the way the OS is configured we will investigate. But random program x not working we often just can’t do anything about.

Of course other users who solve the problem with program x are welcome to share the solution with us and other users, and if it makes sense to tweak OSMC in a way that makes it more compatible with said program we will certainly consider doing this.

As a matter of fact you can’t leave init=/bin/bash in your cmdline.txt - this will boot directly to a shell prompt and prevent normal system startup, so I’m not sure why it didn’t seem to be working for you…(also adding this is nothing to do with ssh access - ssh is provided by a service that runs much later - in fact init=/bin/bash will disable ssh since it will disable all service startup)

You’ll be pleased to know I have added a feature to hold down shift at the beginning of boot to go directly to a recovery console:

https://github.com/samnazarko/osmc/blob/master/package/splash-osmc/files/sbin/splash_early

This will run an fsck, then give you a root bash prompt with normal startup (including systemd) disabled, so this is 99% guaranteed to be accessible even if your startup sequence is badly messed up. This is fairly similar to init=/bin/bash but with a few frills like mounting /proc, /sys, remounting root rw and mounting /boot automatically for you, making it a lot more convenient to use.

A second recovery option that will be added is the option to boot to a normal getty tty login instead of Kodi by holding down Ctrl during boot:

The advantage of this method over the first is that it is a full normal boot with all services running, network started and so on, but minus Kodi - ideal for fixing problems with Kodi or just if you want to log in to a console without loading Kodi first then quitting it.

In the case that the normal boot process can’t get this far you can still use shift for the recovery console.

Finally Ctrl+Shift held down during boot will run a full apt-get update && apt-get dist-upgrade using the familiar blue progress screens to help get out a of a situation where an update can’t be done via the OSMC settings addon for some reason.

I think this should cover all bases, and should appear in the next RC or final.