Bug 469801

Summary: Respect systemd shutdown inhibition
Product: [Plasma] plasmashell Reporter: Harald Sitter <sitter>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: faerbit, nate, orion, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.27.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Harald Sitter 2023-05-15 11:15:52 UTC
SUMMARY
When systemd inhibits shutdown we ignore it currently, we should honor it by default with opt out for admin users

STEPS TO REPRODUCE
1. systemd-inhibit --mode=block sleep 30
2. shutdown from kickoff

OBSERVED RESULT
shutdown happens

EXPECTED RESULT
shutdown shouldn't happen

SOFTWARE/OS VERSIONS
Operating System: KDE neon Testing Edition
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 5.19.0-38-generic (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 3600X 6-Core Processor
Memory: 31,3 GiB of RAM
Graphics Processor: AMD Radeon RX 5700 XT

ADDITIONAL INFORMATION
A possible implementation could check login1 ListInhibitors() for shutdown inhibitions and if there are any refuse to shutdown if the user is not an admin user. a list of inhibitions should probably be displayed so the user knows why/what is causing the inhibition. if the user is an admin user there should additionally be a button to override the inhibition. this behavior would be consistently with systemctl itself.

this notably is useful when a distro is doing some important task that must not be interrupted (such as a system update). it would then install an inhibition that we should respect
Comment 1 Orion Poplawski 2025-05-15 17:04:40 UTC
This is a big issue for us.  We have an automatic update process that runs in the background and takes out an inhibit.  There is no notification of the user when they go to shutdown that this is in place.  The gui gets terminated to a black screen with a cursor but then systemd blocks the shutdown leaving an unresponsive system.
Comment 2 Faerbit 2025-10-08 00:18:28 UTC
From my experience the shutdown doesn't even continue, once the inhibit lock is gone. It just hangs with a black screen.