Ubuntu: “Reached target Shutdown”, safe to pull the plug

rebootUbuntu

I have a small Celeron machine which runs Ubuntu 16.04.3 LTS, and every time I need to reboot it (about once a month), I have to power it off, pull the plug and power it on again.

The thing is that it won't reboot automatically, because it stops with a message Reached target Shutdown. So I've stopped using sudo reboot, but do a sudo poweroff instead and shortly thereafter that message appears.

When I wait for a couple of minutes an additional message is shown 3102533.654120 unregister_netdevice: waiting for lo to become free. Usage count=1. The second (as in time measurement) counter is high, about 3102533, which amounts to about 36 days, probably the time of the last reboot. So there is still something running in the background issuing that message.

Since this already happened before, and most of the Google hits are related to Docker, I made sure to stop all containers docker stop $(docker ps -a -q), and to shut down the docker service sudo systemctl stop docker before issuing the sudo poweroff.

In that strange power off state it is also not possible to power off the machine with a normal power button press (a very long press does power it off, iirc) and a reset button press does also not restart the machine, which I find to be very strange. It's a http://www.asrock.com/mb/Intel/N3150DC-ITX/

What causes the most concern to me is the fact that the "hdd"-light (it's a ssd) is sporadically blinking up, as if it were interacting with the disc, which makes me afraid of corrupting something when pulling the power plug. https://www.youtube.com/watch?v=T3ojE1un7WE

Is it safe to pull the plug? How can I track down the cause of this problem? I can't do much rebooting with the machine, as it hosts some databases which are constantly getting accessed.


Above was on Feb.12, what follows is on Mar.16

I just "rebooted" the machine again. Same procedure as above, since it won't turn off.

This time I did no apt upgrade/dist-upgrade before rebooting, I did that afterwards, to make sure that something being upgraded is not the cause for this problem.

I pressed ctrl-alt-del a couple of times while waiting for it to shut down, it had no effect, until a message appeared:

Ctrl-Alt-Del was pressed more than 7 times within 2s, rebooting
immediately

(I don't think that I pressed them that quickly, I believe that they got cached somehow or I pressed it for a long time) followed by a

2697473.41.. systemd-shutdown[1]: Failed to finalize DM devices, ignoring (the extra space before DM is part of that message)

and then a

2697473.63.. reboot: Restarting system

But it won't restart, the HDD light will still flicker occasionally, the display won't clear the messages.

Pressing the reset button does not reset the machine. The button it not faulty.

A long-press of the power button powers off the machine. Another press restarts it, then the reset button works as expected, I can press it at any time and it will cause the system to restart immediately.

After it was powered on, I did the apt update/upgrade/dist-upgrade and sudo poweroff'ed it again. It powered off just fine.

There is something really weird happening when the machine is powered on for days, which then must be causing this problem.

I'm using molly-guard, I'm not sure if maybe that could cause some issues. When I issue the sudo shutdown I do it locally on the attached keyboard, so molly-guard has no effect. But I doubt that molly-guard is the source of the trouble.

I did a top -b > test-pre-reboot-no-upgrade.txt prior to issuing the sudo shutdown, here is the output https://pastebin.com/nZnJzRKu

Best Answer

Try add param nolapic in grub.cfg

run

sudo update-grub

https://help.ubuntu.com/community/BootOptions

helped me

tried these parameters here noapic nolapic noacpi irqpoll noapm nodma nomce

otherwise it did not help. Solved the question - recompiled initramfs:

sudo update-initramfs -u

Related Question