Skip to content

Steam Reaper

Eamonn Rea edited this page Jun 3, 2023 · 8 revisions

The way SteamTinkerLaunch handles the Reaper command is changing. When it was first noticed in #269, the Steam launch process was different. For further information on Reaper and how it works now, see #814.

Overview

Reaper is a seemingly proprietary tool from Valve that comes as part of the Steam client, which is used to track and clean up child processes of games when they are quit.

When a game is launched from Steam, the reaper process is started with or after the %command%. This %command% is the actual launch command that Steam runs when the "Play" button is pressed. In the case of SteamTinkerLaunch, this is the commandline option in the compatibility tool files. What this means is reaper will always be started with any game launched from Steam, including tools like SteamTinkerLaunch. Most likely, this change was made because Valve want to be more strict when cleaning up any child processes on Steam Deck/Big Picture that might be related to a game, so reaper is launched and it assumes that any process spawned from the launch process is a child process of the program.

In 99% of cases this is correct, and allows Steam to easily clean up rogue processes started by applications when a user presses the "Stop" button from the Steam UI. Reaper will kill all of the processes it tracks as the child processes of the game. However, this breaks some use-cases for SteamTinkerLaunch such as forked custom commands, since processes forked into the background will be closed by Reaper.

In the past, Reaper was passed to a game by Steam as part of the launch command. Steam used to pass various commands such as Reaper and the Steam Linux Runtime via the start command, which SteamTinkerLaunch would parse the necessary commands out of, so that it could accurately build a launch command that reflected the game launch, as well as provide the option to disable some of the commands coming from Steam, such as the option to disable Reaper. However this is no longer possible as Reaper is launched by Steam and is not sent with the launch command. For this reason, SteamTinkerLaunch has to change how it handles Reaper.

Disabling Reaper

With SteamTinkerLaunch, Reaper is enabled by default, mirroring the default behaviour from Steam.

When using a Proton game (i.e. using SteamTinkerLaunch as a Steam Compatibility Tool), disabling the checkbox will check for and kill the Reaper process at game startup using pgrep -x reaper and pkill. One reason to disable Reaper is to keep a given process opened after a game is closed, and when you don't want this process to be seen by Steam as a child process. If you want an application to open with your game and remain open independent of the game, you might want to disable Reaper.

For Native Linux games, SteamTinkerLaunch will simply build the game start command with or without Reaper depending on the checkbox. Since native games use SteamTinkerLaunch as a Steam Launch Option, the Reaper command comes as part of %command%, so we can parse for this and build the start command without it.

Issues with Disabling Reaper

Disabling Reaper and attempting to force close a game from Steam with the "Stop" button may cause it to hang at "Stopping". This is probably because Steam expects Reaper when using this button but cannot find it. If this happens you may have to use a process monitor to clean up any lingering processes, or at worst, restart Steam. To avoid this scenario altogether, you can exit a game directly from its menu, or kill the game process(es) from a process monitor.

  • Tip: KDE has a shortcut Ctrl+Alt+Esc which allows you to click on a window to force close it. Other desktop environments may offer similar options.

It is important to note that Steam expects Reaper to be present and available to close game processes, so disabling Reaper may have undesirable consequences. It should be obvious, but you should only disable Reaper if you know what you are doing and have a specific use-case in mind! This should is especially important for devices like Steam Deck or distros that allow GameScope sessions, as it may prevent processes from being closed cleanly!

These issues cannot be solved by SteamTinkerLaunch, they are simply a result of how Steam handles game launches (at time of writing, at least).

Clone this wiki locally