Repository navigation
Session is not closed when shutdown starts while another process holds a delay inhibitor #214
Description
Still reproducible on current master (d10f424, 6.7.4-unstable).
Problem
When the user asks for shutdown or reboot, cinnamon-session runs its end-session phases and then calls logind PowerOff(), but it never terminates itself. If any other process holds a delay shutdown inhibitor, logind postpones the transition and the session stays on screen in a half-terminated state: it is already past the RUNNING phase, so the panel's next org.gnome.SessionManager.Shutdown call fails with
GDBus.Error:org.gnome.SessionManager.NotInRunning: Shutdown interface is only available during the Running phase
the desktop icons are gone because the apps were already asked to end, and yet applications can still be launched. The machine only powers off when the other inhibitor is released.
The original report comes from a unattended-upgrades setup with InstallOnShutdown "true" and InhibitDelayMaxSec=1800, but any long delay inhibitor triggers it. With the default InhibitDelayMaxSec of a few seconds nobody notices.
How to reproduce
systemd-inhibit --what=shutdown --mode=delay --who=test --why=test sleep 300
then shut down from the Cinnamon menu: the session stays visible and usable for the whole delay.
Where it comes from
csm_manager_quit() (cinnamon-session/csm-manager.c:487) exits the session for logout, but not for shutdown/reboot:
case CSM_MANAGER_LOGOUT_LOGOUT:
csm_quit ();
break;
...
case CSM_MANAGER_LOGOUT_SHUTDOWN:
case CSM_MANAGER_LOGOUT_SHUTDOWN_INTERACT:
csm_system_attempt_stop (manager->priv->system); /* line 520, no csm_quit() */
break;csm_systemd_attempt_stop() (csm-systemd.c:236) just calls PowerOff(TRUE) and relies on systemd to tear everything down. cinnamon-session also never takes a delay inhibitor of its own: csm_systemd_add_inhibitor() only ever takes block ones on behalf of session apps (csm-systemd.c:629).
gnome-session handles this differently: gsm_systemd_prepare_shutdown() takes its own delay inhibitor before calling PowerOff/Reboot, and gsm_manager_quit() then calls gsm_system_complete_shutdown() (which drops that inhibitor) followed by gsm_quit(). The session goes away in any case, and the shutdown proceeds once the remaining inhibitors allow it.
Suggested fix
Port that split rather than simply adding a csm_quit() after csm_system_attempt_stop() — the PowerOff call is asynchronous, so quitting right after it would cut it short. That is: take a delay inhibitor before requesting PowerOff/Reboot, release it at quit time, and let the session exit.
Related reports
- Session doesn’t shutdown with LightDM until all unattended upgrades finish #143 — same issue, opened in 2021, body was only a link to the Debian bug; never triaged and auto-closed as stale in April 2026. Hence this new issue with the details.
- Cinnamon creates a
blocksystemd inhibitor when a user application createsdelayinhibitor #147 / Cinnamon creates ablocksystemd inhibitor when a user application createsdelayinhibitor #194 / Cinnamon creates ablocksystemd inhibitor when a user application createsdelayinhibitor #195 — cinnamon-session creating ablockinhibitor when an application asks for adelayone. Same area, different problem. - Restart/Shutdown goes to Login screen #186, fixed by 8042c7f (clearing the session inhibitors before
PowerOff) — that one is about shutdown being refused, not delayed, and does not change the behaviour described here. - Debian bugs: https://bugs.debian.org/987612 (now reassigned to cinnamon-session) and the original https://bugs.debian.org/987431 against unattended-upgrades, where the analysis started.
Activity
leigh123linux commentedon Aug 30, 2026
@Fantu Can you test my Pr
Cinnamon exits immediately to lightdm. lighdm then waits for the inhibitor to clear.
Fantu commentedon Aug 30, 2026
Thanks, did a fast test and is correct.
However testing I thinked, that the user, upon reaching the login screen, might still not understand why the shutdown is delayed (such as the first notification with unattended-upgrade).
I tried logging back in, and it created a new, complete, and functioning cinnamon session, and then, after a while, it completed the shutdown.
I assume, however, that any improvement in this case isn't possible from cinnamon, but from systemd and/or the login manager (I not searched about, I'm busy in other things today).
In summary, the fix is still necessary and it works.
leigh123linux commentedon Aug 30, 2026
lightdm doesn't respect the preparing_for_shutdown signal, it will need support for it so it can block login.
d/patches: backport upstream 9409c18b, quit the session once logind p…