Regarding the shutdown mechanism of KDE and systemd inhibit

I encountered a problem on KDE. I’m using version 26.04 of KDE. When I registered a root-privileged systemd-inhibit and then shut down the system, you would notice that although the session ended, the system would get stuck at some stage after the session was exited. And I tried it on 2504 as well and it always had this issue. So I would like to ask if any friends know the reason for this? I would be very grateful.

It doesn’t seem to be stuck. The system is still responding. I suspect it’s caused by the root systemd-inhibit. During the shutdown process, it will first terminate the session. Inhibit cannot prevent the termination of the session, but it prevents the shutdown request for lsystemd-logind that is called last.