[Software] Debian won't shutdown

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
sebaptcd
Posts: 1
Joined: 2025-02-21 12:22

[Software] Debian won't shutdown

#1 Post by sebaptcd »

My system hangs on shut down.

In Gnome, I go to the shut-down button, the system starts the shutdown process but it never finishes. The system must be then force shut down from the button.
Interestingly, when I shut down from the button, the system also opens back again as it would have been closed and only now I am starting it.
This happens at random. I could not detect a specific way to replicate the issue, but it is most likely to happen after the system is opened for more than 12 hours.

This is the log. It just stays like that without shutting down.
20250216_112535-low.jpg
20250216_112535-low.jpg (424.19 KiB) Viewed 152 times

This has started to happen after the 12.6 update on my system. However, I found users reporting this issue from as early as Debian 10.

My system:
- Debian 12.9
- Gnome
- Linux 6.12.9 backports (happened as well before the backport on 6.1)
- systemd 254.22 backports (happened as well before the backport on 252.33)
- nouveau 2.4.123 backports (happened as well before the backport on 2.4.114)
- Windows 11 dual boot (happened before upgrading to 11 as well, on 10)

My system has many hard drives, both internal and external, encrypted + an internal DVD/CD writer/reader. After looking through the issues, I thought this info might also be relevant.

After researching for way too long, I narrowed the issue down to either systemd, nouveau or maybe the TPM? (see relevant link below).

Relevant documentation about the issue:
viewtopic.php?t=158398
https://github.com/systemd/systemd/issues/28490
https://github.com/systemd/systemd/issues/15004
https://unix.stackexchange.com/question ... s-ignoring


Other relevant information I found related to the issue:

https://forum.proxmox.com/threads/solve ... ty.129604/
viewtopic.php?t=150438
https://unix.stackexchange.com/question ... -shut-down
https://bugs.debian.org/cgi-bin/bugrepo ... =939170#30

It is unfortunate to have this apparently simple thing not working (the shut down process) so would be great to find a fix for it.

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: [Software] Debian won't shutdown

#2 Post by kalle123 »

Welcome to the forum :D

As no one answered until now, I'll give it a try. :wink:

#1. Think, the printout of a

Code: Select all

 inxi -Fz 
would give users here an overview on your system.

#2. I would remove everything from that machine, which is unnecessary for running Linux.

Disconnect additional drives, boards, WIFI, LAN, BT etc. which are not essential.

Make it simple, real simple.

Anything changed?

#3. Reset the BIOS settings to default.

Anything changed?

Take it like a game, 'back to START!'

User avatar
pbear
Posts: 570
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 94 times

Re: [Software] Debian won't shutdown

#3 Post by pbear »

I'm no expert on this topic, but "Not all DM devices detached, 1 left" looks like the culprit. Any idea what that might be? In any event, what I would do is close everything I can before shutdown, especially unmount files systems (except / , of course) and close encrypted partitions. Then shutdown and see whether the squawk persists. If the procedure works, I'd write a shell script to automate the process and call it done.

The odds this will be fixed by the developers are nearly zero, unless you can furnish a path to reproduce the problem. Whereas, shutdown bugs usually manifest only under very particular hardware/OS configurations.

mrmazda
Posts: 595
Joined: 2023-06-02 02:22
Has thanked: 15 times
Been thanked: 75 times

Re: [Software] Debian won't shutdown

#4 Post by mrmazda »

As I use neither virtualization nor device-mapper devices, what you find in yours that is not in mine may point you to a culprit to investigate:

Code: Select all

# dmesg | egrep 'kvm|dm' | grep -v dma
[    0.569561] IPv6: Loaded, but administratively disabled, reboot required to enable
[    4.503779] systemd[1]: Starting modprobe@dm_mod.service - Load Kernel Module dm_mod...
[    4.522684] device-mapper: ioctl: 4.47.0-ioctl (2022-07-28) initialised: dm-devel@redhat.com
#

User avatar
kent_dorfman766
Posts: 598
Joined: 2022-12-16 06:34
Location: socialist states of america
Has thanked: 79 times
Been thanked: 78 times

Re: [Software] Debian won't shutdown

#5 Post by kent_dorfman766 »

So I learned that running a desktop manager causes my system to do the same thing, but I'm not using gnome or any of the bloated desktops, just openbox under X11...
anyways, I boot to text mode, run my X session, then when ready to shut down, exit X11 and run sudo init [6/0].

I've noted that when trying to shutdown directly from gui mode there is something running that block shutdown for about 5 minutes and then it eventually shuts down...I've not been motivated to solve this since I boot in text mode.

mrmazda
Posts: 595
Joined: 2023-06-02 02:22
Has thanked: 15 times
Been thanked: 75 times

Re: [Software] Debian won't shutdown

#6 Post by mrmazda »

My Debian systems don't use sysvinit, so I use the following:

Code: Select all

# alias | egrep 'eboo|off'
alias OFf='systemctl poweroff '
alias Off='systemctl poweroff '
alias REboot='systemctl reboot '
alias Reboot='systemctl reboot '
#

Post Reply