Skip to content

fix(launch): start the daemon outside Steam's process tree - #109

Merged
mescon merged 1 commit into
masterfrom
launcher/daemon-outside-steam
Sep 18, 2026
Merged

mescon merged 1 commit into
masterfrom
launcher/daemon-outside-steam

Conversation

@mescon

@mescon mescon commented Sep 18, 2026

Copy link
Copy Markdown
Owner

For #105 (DiRT Rally 2.0 left "running" in Steam after exit). Steam's reaper is a subreaper; a daemon the launcher started was reparented to it and kept the game marked running. Reproduced with an emulated subreaper (prctl PR_SET_CHILD_SUBREAPER): the daemon was the one child left. The launcher now starts it with systemd-run --user (output appended to the launcher log), falling back to a session child that is stopped at exit. Both paths verified under the emulated reaper; core tests pass (they caught an unbound variable on the daemon-off path, fixed); shellcheck adds nothing new.

Steam runs the launch command under a subreaper, so a process the
launcher starts and leaves behind is handed to Steam when the game
exits, and Steam keeps the game marked as running until it dies. The
telemetry daemon was that process whenever the launcher had to start
it: DiRT Rally 2.0 stayed "running" after exit until the daemon was
killed by hand (#105). Reproduced under an emulated reaper: the daemon
was the one child reparented to it after the game exited. setsid does
not escape a subreaper. A transient user service does, because systemd
becomes its parent, so the launcher starts the daemon with systemd-run
where that works, output still appended to the launcher log. Where no
user service manager is available the daemon runs as a child of the
session and is stopped when the game exits. Both paths checked under
the emulated reaper: nothing is left for Steam to wait on.
@sonarqubecloud

Copy link
Copy Markdown

@mescon
mescon merged commit 8d22697 into master Sep 18, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant