1

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?

cytsunny
  • 165
  • 1
    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. – Marco Aug 19 '23 at 17:04
  • 1
    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? – Stormlord Aug 19 '23 at 19:10
  • @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. – cytsunny Aug 20 '23 at 02:46
  • 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. – user10489 Aug 26 '23 at 16:16
  • 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. – Marc Vanhoomissen Aug 29 '23 at 09:56
  • Can you drop to single user? eg shutdown now? if that hangs there is a process the system cannot shut down. – Nikolaj Hansen Aug 29 '23 at 10:06
  • @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 Aug 29 '23 at 12:01
  • @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 Aug 29 '23 at 12:02
  • @NikolajHansen Was unable to get into the single user mode due to unable to getting into GRUB menu as mentioned above. – cytsunny Aug 29 '23 at 12:03
  • 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. – user10489 Aug 30 '23 at 00:21
  • @user10489 I have edited the line and run update-grub but was still not getting the menu on boot. – cytsunny Aug 30 '23 at 01:46
  • 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 Aug 30 '23 at 18:21
  • 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. " – Nikolaj Hansen Aug 30 '23 at 18:26
  • @NikolajHansen I have tried running shutdown on my system as root and it also hang. – cytsunny Aug 31 '23 at 01:48
  • 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.

    – Nikolaj Hansen Aug 31 '23 at 06:00
  • @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. – cytsunny Aug 31 '23 at 12:52

1 Answers1

1

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.

  • This is great advice… Can you give an explanation on how to find these items and disable to determine the culprit? – JayTee Feb 03 '24 at 15:00