1

I have an issue with my Raspberry PI running Raspbian 9 hanging on startup - but not always. It will hang every other launch.

When the problem occurs, the launch first hangs with the last message

Starting Show Plymouth Boot Screen

it will hang here for a minute or two (usually it proceeds after like 3 seconds), then proceeds to show splash screen with message

systemd-hostnamed.service

Here it just stops, won't go any further no matter how long I wait. When I unplug the power and plug again, it will always boot properly.

I've seen this question but the author mentions he has changed network interface, which I'm sure I haven't touched. I haven't touched anything actually, aside from installing Maven, NetBeans, BlueZ and some Java libraries. And my Pi eventually boots up properly half the times.

What might be the problem? How to debug this issue further?

1

At first step you can look at

rpi ~$ journalctl

if you see some messages that indicate what could go wrong. The problem is that the systemd Journal isn't stored persistent by default so you don't see messages from a previous boot. You can make the Journal persistent with:

rpi ~$ mkdir -p /var/log/journal
rpi ~$ systemd-tmpfiles --create --prefix /var/log/journal

You will get one or two confusing warnings "...Cannot set file attribute..." This are not error messages, only warnings and doesn't matter in this case. Now you can look at the messages from previous boots with:

rpi ~$ journalctl --boot=-1

or -2 or -3 or ...

  • Beware saving journald data to disk seems to consume a lot more (as in, several orders of magnitude, last I checked) of space vs. plain text messages, so you may want to 1) Restrict the size in /etc/systemd/journald.conf, 2) Attach a regular syslog to write messages in plain text. Pretty sure there is a syslog already on Raspbian by default since there is a (plain text) /var/log/messages, although this may have to be reconfigured to include a dmesg dump at boot. Worth a check though. – goldilocks Oct 12 '18 at 12:46
  • @goldilocks Hmm... haven't thought of this. Will have a look at it and pay attention to it. – Ingo Oct 12 '18 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.