Watching reaper sounds like a good approach. It will be used for things other than running a game too though, such as running install scripts for Proton games that run before the game itself is started.
Well, I did discover a difference in the args between the first reaper and the second reaper. The first reaper has Install=1 as an argument and the second one does not. So it looks like you can pgrep -f 'reaper SteamLaunch AppID=[0-9]+ --' to find the PID of the main reaper. That honestly looks like something that could break anytime this year.
Nothing extracted yet.
Your system information
Please describe your issue in as much detail as possible:
Well, I have this script I use to automatically start Steam to run an app ID, wait until the game it's running finishes, and then automatically exit Steam. It is also supposed to work with Steam already running, and instead just blocks until the game finishes.
The critical piece that made this work was the SteamChildMonit process. All I had to do is poll for a process called SteamChildMonit and then once it appeared, wait for it to die. I didn't expect it to work forever, but it worked for pretty much most of the time that Steam has existed on Linux.
One day it stopped working, and I found that SteamChildMonit was no longer in the process tree when launching a game. There was a new one called reaper, though. So I was like, "okay, sure, we'll just track reaper instead." But I found that with that there instead, I would start games and then Steam would exit almost immediately, which was a thing that never happened before. I found that the PID of the reaper process was different between when the dialog "Preparing to launch whatever" appeared and when the game actually started to run. Which means that as far as my script was concerned, the reaper it found and was watching had left the building, so it needed to run
steam -shutdown.I could do some weird crap like checking for the first reaper and then checking for the second reaper, or seeing if there is a difference in the arguments between the first and second, but I figured it would be a better idea to come here and ask instead: is there a more reliable way to check if Steam is currently running a game?