Score:1

Unable to fully shut down the computer on Ubuntu 22.04

cn flag

Starting from around a week ago, my computer just cannot shut down completely. It looks like its shutting down and the screen goes black but the computer itself does not stop working and the light does not turn off. The status is similar to standby mode, except that it won't start up again when I click the power up button. I need to disconnect the electricity to forcefully shut it down before I can turn on my computer again.

I have tried using the command sudo shutdown -h now to shutdown the computer. The same thing happen. Restarting the computer works fine. At the moment I have to keep my computer on as I don't want to forcefully shut down my computer too many times.

I saw a similar question here, but that was 12 years ago on Ubuntu 10, and there was no real solution under that question as well.

I have do a virus scan using ClamTK and nothing suspicious is found. (except those PUA on my Steam Proton and Brave browsers, which I guess should be safe to omit)

I understand at this stage there may not be enough information to determine what is the underlying problem, but what can go wrong and cause the problem? What should I check?

Marco avatar
br flag
shutdown is handled by a systemd target. Maybe somewhere in systemd there is a misconfiguration? It is possible to configure services which run "on shutdown", e.g. updates. Maybe one of them blocks the shutdown.
ru flag
Let's run a test and see if it's a configuration or a hardware problem. You wrote that the problem started approximately a week ago. This means the system was shutting down correctly before that. You can use the USB stick which you installed your system from (or create a new one if needed), restart your system and boot it from that stick and do a shutdown from that system. Does that work or does the system behave the same way?
cytsunny avatar
cn flag
@Stormlord I have just tried to boost from my USB that I used to install my Ubuntu system and try shutting down. It shuts down normally, so I believe the hardware is fine, but I guess I need some more guide on how to figure out the configuration problem.
user10489 avatar
in flag
I suggest you shut down the graphics system (systemctl stop gdm.service or something like that) and drop to a text console and shut it down and watch the log messages. Maybe you can spot which service is hanging on shutdown.
Marc Vanhoomissen avatar
in flag
I suggest to restart the computer using an earlier version of the Kernel (At startup, when you see the GRUB menu, choose `Advanced options for Ubuntu` and choose a previous version. Then, try to shutdown. This to make sure the problemn is bound to a new version of the kernel or not.
Nikolaj Hansen avatar
in flag
Can you drop to single user? eg shutdown now? if that hangs there is a process the system cannot shut down.
cytsunny avatar
cn flag
@user10489 Shutting down the graphics system using `systemctl stop gdm.service` make the hangs at a page with a single flashing underscore. I have tried switching to tty3 by pressing ctrl + alt + F3 and run `shutdown -h now` there. The computer shut down correctly.
cytsunny avatar
cn flag
@MarcVanhoomissen The booting up is too fast and I have some difficulties in getting into the GRUB menu, but I was able to boot from a USB with an older version of Ubuntu (and of course together with an older version of Kernel) and it shuts down correctly.
cytsunny avatar
cn flag
@NikolajHansen Was unable to get into the single user mode due to unable to getting into GRUB menu as mentioned above.
user10489 avatar
in flag
With the system up, edit /etc/default/grub and change the appropriate line to `GRUB_TIMEOUT_STYLE=menu` and run `update-grub` and then you should get the menu on boot.
cytsunny avatar
cn flag
@user10489 I have edited the line and run `update-grub` but was still not getting the menu on boot.
Nikolaj Hansen avatar
in flag
You do not need grub to drop to singe user here. Just do a shutdown on your system as root - that will drop you to single user. Does this also hang?
Nikolaj Hansen avatar
in flag
Actually this may also be systemd infected now (making this work differently on linux than other nix'es..) from man shutdown "The shutdown command in previous init systems (including sysvinit) defaulted to single-user mode instead of powering off the machine. To change into single-user mode, use systemctl rescue instead. "
cytsunny avatar
cn flag
@NikolajHansen I have tried running shutdown on my system as root and it also hang.
Nikolaj Hansen avatar
in flag
Do you start any daemons on your system like the Apache Web server, a database server or otherwise during startup, or is it "just" a vanilla system? If yes - turn them of so they do not startup / shutdown with the system. Try to unhook all Peripheral physical devices and repeat the process.
cytsunny avatar
cn flag
@NikolajHansen I do have Apache Web server and MySQL database, but they are not started during start up. I need to turn them on by hand, so it is "just" a vanilla system.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.