session: Add a drop-in for the application scopes cinnamon creates - #213
Open
Fantu wants to merge 1 commit into
Open
session: Add a drop-in for the application scopes cinnamon creates#213Fantu wants to merge 1 commit into
Fantu wants to merge 1 commit into
Conversation
Cinnamon puts every application it launches into a transient app-cinnamon-*.scope. Those scopes are created with just a PID list, so by default systemd knows nothing about their lifetime: on logout they are torn down abruptly when the user instance goes away, and if the user has lingering enabled they are not torn down at all. Ship the same drop-in gnome-session ships for its own scopes: PartOf=graphical-session.target ties them to the session, TimeoutStopSec gives applications a moment to exit before being killed, and CollectMode keeps failed units from piling up. This relies on graphical-session.target being activated by the session, which is the case since commit e01c8c3. Assisted-by: Claude Code:claude-opus-5
This was referenced Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With linuxmint/cinnamon-desktop#275, cinnamon puts every application it launches into a transient
app-cinnamon-*.scope. Those scopes are created with nothing but a PID list, so systemd knows nothing about their lifetime: at logout they are torn down abruptly when the user instance goes away, and if the user has lingering enabled they are not torn down at all.This ships the same drop-in gnome-session ships for its own scopes (
data/app-override.scope.conf, installed intoapp-gnome-.scope.d/):PartOf=graphical-session.targetties the applications to the session, so they are stopped when it ends instead of being killed when the user instance goes down.TimeoutStopSec=5sgives them a moment to exit cleanly first.CollectMode=inactive-or-failedkeeps failed units from piling up.This relies on
graphical-session.targetbeing activated by the session, which has been the case since e01c8c3 (#204).Testing
Mint 23, Cinnamon 6.7.4 with the cinnamon-desktop fix applied — the drop-in is picked up by the scopes as they are created:
One caveat worth stating
graphical-session.targetbelongs to the systemd user instance, which is per user, not per session. If the same user has two graphical sessions running at once, logging out of one stops the application scopes of the other as well. Before application scopes existed the applications lived in their ownsession-N.scopeand were unaffected. This is the same trade-off GNOME makes, and the multi-session case is rare, but it is a real behaviour change.