How to debug linux startup hang

Konstantin Solomatov asked:

My ubuntu system hangs on the startup. It hangs on [OK] items like usual on boot. Interestingly, I am able to ssh onto this machine, but the boot never finishes and login screen doesn’t appear. What should I do to debug the problem?

My answer:

Since you can log in to the system, you can use systemctl to find any units that are hanging or failed to start correctly. For example:

systemctl list-units --state activating,reloading,failed

What you do next depends on the specific units that are having a problem. In general you would look at their journal entries/logs to see if a problem is obvious.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.