Skip to content
Snippets Groups Projects
  1. Jul 29, 2022
  2. Jul 28, 2022
  3. Jul 25, 2022
    • Simon McVittie's avatar
      launch-options: Simplify launcher-service integration · 1e478218
      Simon McVittie authored
      
      We're now looking at using descriptive tool names like "proton"
      and "container-runtme", rather than app-IDs. Follow that here.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      1e478218
    • Simon McVittie's avatar
      bin: Add a simpler interface to wrap a game in the launcher-service · c0842d08
      Simon McVittie authored
      
      If launcher-service is (mostly) mechanism, then this is policy.
      It uses argv[1] and $STEAM_COMPAT_LAUNCHER_SERVICE to decide whether
      to wrap a launcher-service around a game process. The idea is that
      Steam will set STEAM_COMPAT_LAUNCHER_SERVICE to the most appropriate
      layer of the stack at which to be inserting arbitrary debugging
      commands into a game.
      
      In previous prototypes, this was open-coded into each compat tool, but
      centralizing it is a lot easier for compat tool authors. Put a version
      in the name we use, to ensure that if we find we need to make breaking
      changes, we can rename to a new interface version (and optionally keep
      the old one around too).
      
      To minimize its startup time cost, this doesn't use GLib, only glibc.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      c0842d08
    • Simon McVittie's avatar
      launcher-service: Optionally show a hint about how to connect · 45d542a6
      Simon McVittie authored
      
      In the current prototypes, each compat tool is responsible for
      displaying a hint like this (if it wants to), but there are two problems
      with that:
      
      - each compat tool has to duplicate the code for finding a launch-client
        and suggesting how to launch it;
      - the compat tools can't know whether the service is providing multiple
        bus names via the --session option
      
      Move responsibility for this into the service.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      45d542a6
    • Simon McVittie's avatar
      launch-options: Don't create a redundant xterm wrapper · 54ab89d4
      Simon McVittie authored
      
      The precedence here was interpreted as
      
          s is not None or (t is not None and not h)
      
      instead of the intended
      
          (s is not None or t is not None) and not h
      
      resulting in an unintended second layer of xterm wrapper, even when
      using a container runtime.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      54ab89d4
  4. Jul 21, 2022
  5. Jul 20, 2022
  6. Jun 24, 2022
  7. Jun 23, 2022
  8. Jun 22, 2022
  9. Jun 16, 2022
  10. Jun 15, 2022
  11. Jun 14, 2022
    • Simon McVittie's avatar
      launcher-service: Add --exec-fallback option · 273a86b9
      Simon McVittie authored
      
      This could be useful if we're routinely wrapping games in the launcher
      service: if that's the case, then we'll want to fall back to running the
      game without the launcher service if setup fails, rather than just not
      running any games until it's fixed.
      
      Resolves: steamrt/tasks#129
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      273a86b9
    • Simon McVittie's avatar
      launcher-service: Add automatic choice of bus name · d8e36a82
      Simon McVittie authored
      
      This might make sense to be the default later, but for now it has to be
      requested explicitly.
      
      It currently only sets up com.steampowered.App1234. Additionally
      listening for ...App1234.Instance54321 could be added later if wanted.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      d8e36a82
    • Simon McVittie's avatar
      launcher-service: Allow more than one well-known bus name · ecbbd591
      Simon McVittie authored
      
      This might be a useful way to have both per-app and per-instance bus
      names, for example com.steampowered.App1234 and
      com.steampowered.App1234.Instance54321 on the same server.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      ecbbd591
    • Simon McVittie's avatar
      launcher-service: Implement and test --[no-]stop-on-exit options · 44b681e4
      Simon McVittie authored
      
      These can be used to make the command-launcher service linger after a
      game has exited. For example, if the game crashes too soon after startup
      to be able to attach a debugger, this allows it to be re-run.
      
      Resolves: steamrt/tasks#127
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      44b681e4
    • Simon McVittie's avatar
      launcher-service: Implement a --[no-]stop-on-name-loss option · db4d2609
      Simon McVittie authored
      
      This can be used to keep the launcher service alive even if it has been
      replaced by another similarly-named launcher, for example when using a
      well-known name per Steam game.
      
      Resolves: steamrt/tasks#128
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      db4d2609
    • Simon McVittie's avatar
      launch-client: Clarify behaviour of --terminate -- COMMAND · 695c2a63
      Simon McVittie authored
      
      Previously, the synopsis implied that --terminate was only allowed when
      not specifying a COMMAND, and the exit status description implied that
      `s-r-launch-client --terminate -- false` would exit 0 (in fact it
      propagates the exit status from false(1), and exits 1).
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      695c2a63
    • Simon McVittie's avatar
      launch-client: Exit 0 if Terminate() succeeds · 61fd3218
      Simon McVittie authored
      
      Previously, both success and failure came out as exit status 125,
      contradicting the man page, which said a successful --terminate
      was exit status 0.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      61fd3218
    • Simon McVittie's avatar
      launcher-service: Don't exit on name loss if children exist · ed8e4961
      Simon McVittie authored
      
      Instead of using a GMainLoop, it's often clearer what is going on if we
      explicitly loop until a condition becomes false, and that seems to be
      the case here.
      
      Keeping better track of the circumstances under which we exit revealed
      that if we lose our D-Bus name (due to being replaced by a second
      instance with --replace), we would have exited after a short delay.
      This seems unfortunate, because we don't terminate our child processes
      in that situation, but exiting from the launcher-service process means
      that the launch-client processes cannot be informed when the child
      processes exit or given the opportunity to send signals to them, even
      if they are tracking the launcher-service by its unique name (as we
      started to do in a previous commit). Resolve this by continuing to not
      terminate the child processes, but also lingering until they have all
      exited, so that we can propagate their exit statuses back to the caller
      if it is watching our unique name.
      
      Similarly, in signal_handler() and exit_on_readable_cb(), previously we
      would unconditionally stop the main loop immediately. Now, we wait for
      child processes to exit and for a possible queue of D-Bus calls to be
      processed.
      
      Related to steamrt/tasks#128
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      ed8e4961
    • Simon McVittie's avatar
      launcher-service: Fall back to kill() if killpg() fails · 565cd31e
      Simon McVittie authored
      
      If the process we are terminating is not a process group leader, then
      killpg() will fail with ESRCH. This is particularly significant if we
      are terminating a wrapped process, for which we set
      `child_setup_data.keep_tty_session = TRUE` so that it will not give up
      its controlling terminal (if any).
      
      Before this change, `test_wrap_wait` in tests/pressure-vessel/launcher.py
      would leak its `sleep 600` subprocess, which was not correctly
      terminated by calling `s-r-launch-client --terminate`. Replace that
      with a `cat` subprocess so that we can detect when it has been
      terminated, and replace the previous use of stdout (which duplicated
      similar code in `test_wrap_info_fd`) to facilitate that.
      
      This will become more important when we keep better track of child
      processes in order to avoid exiting while there are still managed child
      processes running.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      565cd31e
    • Simon McVittie's avatar
      launcher-service: Clarify the name of an internal function · cba09f2e
      Simon McVittie authored
      
      This wasn't particularly descriptive, and I now want to use the name
      pv_launcher_server_stop() for something else.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      cba09f2e
    • Simon McVittie's avatar
      launcher-service: Clarify --terminate message · fbfc602b
      Simon McVittie authored
      
      With the `terminate-after` option, processes that make us exit are not
      necessarily the "main" process.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      fbfc602b
Loading