Instead of depending on direct descendants of our process exiting as
a signal for checking the process tree, poll 10 times a second
instead. This allows us to build some sensible "game start detection"
which fixes behaviors when the initial game process is considered
excluded (such steam/winesteam games).
It has a minor consequence of making lutris-wrapper much more
complicated. I tried my best to add some comments to explain what
is going on. I also added another test.
Rather than waiting for the initial process to exit before we start
reaping child processes, instead launch the initial process async
and use the same wait3->reap loop on the initial process as the
inherited processes.
Refactor util/monitor and util/process to stop emiting logging
information or attempting to track state changes since POSIX signals
don't give us enough opportunity to track this information reliably.
I'm sure some users will be happy to not see their terminal spammed.
Python files are installed into `$DESTDIR/lib/lutris`
Scripts in `/bin` have been edited to search **ALL** module inside this dir
Datas are also searched in `</lib/lutris>/../../share/lutris`, this allow weird DESTDIR like `/tmp/lutris` (tested)
Now Lutris assume that libdir is located in `<bindir>/../lib`
This is minimalist right now and should work for everyone
If any process lutris was monitoring died in-between it being detected and it having a `kill` attempted on it, lutris-wrapper would have a `ProcessLookupError` exception occur and would stop trying to kill any other processes and halt the shutdown. Fix this by catching this specific exception and ignoring it.
Fixes#2142.
An extension to the work done in #1835 and relevant to #1798.
When performing a force stop, also kill processes that would normally be considered "excluded". In addition, perform up to three rounds of process collection/killing in an attempt to beat races involving new processes being created.
If `lutris-wrapper` receives and processes a `SIGTERM` but then receives another one, kill all tracked children with `SIGKILL`. This feature is a part of the work necessary to fix#1798.
Added a test for `lutris-wrapper`.