- Nov 17, 2022
-
-
Simon McVittie authored
This does a few closely related things. If standard input, standard output and standard error are closed, we open them to point to /dev/null, and if they are close-on-exec, we clear their close-on-exec flags. This is to avoid weird side effects: most APIs like open() that create new file descriptors guarantee to use the lowest-numbered fd that is not already in use, but users of those APIs do not expect to be overwriting stdin/stdout/stderr. Because that operation can involve changing the meaning of stdout and stderr, we now optionally save a duplicate of the original standard output and standard error, so they can be put back later. Because we're now saving a duplicate of the original standard output and standard error, it also makes sense to implement SRT_LOG_FLAGS_DIVERT_STDOUT here. This avoids needing to call _srt_divert_stdout_to_stderr() separately in most callers. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
If we are going to write to the systemd Journal, we will want the program name to already be known, so that we can use it as the syslog identifier (first argument to sd_journal_stream_fd() and openlog()). This also reduces duplication a bit, and brings us one step closer to combining _srt_util_set_up_logging() with _srt_util_set_glib_log_handler(). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Nov 16, 2022
-
-
Simon McVittie authored
These were intended to be written to the original stdout, but we didn't do that until after we'd already replaced stdout with stderr to avoid random diagnostic messages appearing on the original stdout. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Nov 03, 2022
-
-
Simon McVittie authored
We can use this to set up different types of logging with a single log handler, which will make it easier to add new flags, such as a flag to make the log more deterministic to minimize diff. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 19, 2022
-
-
Simon McVittie authored
We need to do this before the earliest point where we might g_debug(). This fixes corrupted TAP output during build-time tests on Steam Runtime 1½ 'heavy' when G_MESSAGES_DEBUG=all and at least one of stdin, stdout or stderr is a terminal. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jul 28, 2022
-
-
Simon McVittie authored
I contributed this to flatpak-spawn in early 2021. It avoids the variables' values being visible in /proc/*/cmdline to other users' processes, and also avoids having a very long command-line if a lot of environment variables need to be propagated. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This ensures that an interactive shell gets the right TERM set, even if Steam itself was not run from a terminal. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This provides a way to undo previous or automatically-set environment variables. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This makes it a little bit easier to run shell logic like s-r-launch-client ... -c 'if foo; then bar; fi' or s-r-launch-client ... -c 'kill -INT $MAINPID' for which a shell interpreter is required. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This matches the behaviour of ssh, pkexec and similar tools. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
When we are behaving like flatpak-spawn(1), its behaviour of inheriting the current working directory makes sense: flatpak-spawn is meant to run a command with different sandboxing, but as though it was a child of the current process. Also, the current working directory for the flatpak-portal and flatpak-session-helper services is uninteresting (99% of the time it will be the user's home directory), so it will not usually be useful to inherit. However, when we are inserting commands into a running game, it makes more sense to inherit the game's current working directory, which is non-trivial (usually but not always the game's top-level installation directory). Change s-r-launch-client so it does that by default, instead of forcing its own working directory. steamrt/tasks#145 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jul 21, 2022
-
-
Simon McVittie authored
This allows the program on the service side to take the pseudo-terminal as its controlling terminal, giving it proper job control. steamrt/tasks#125 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 22, 2022
-
-
Simon McVittie authored
When this code moved into the shared library, it wasn't adapted to take into account pressure-vessel and steam-runtime-tools being separate log domains. The result was that PRESSURE_VESSEL_VERBOSE actually only made libsteam-runtime-tools verbose, and info/debug messages from the pressure-vessel directory were lost. Fixes: 2194b59a "Move pressure-vessel's logging setup into library code" Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 15, 2022
-
-
Simon McVittie authored
This is a convenient way to list possible targets. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 14, 2022
-
-
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:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
The launcher API is stateful: once we have asked an instance of the launcher to start a subprocess, we must send any subsequent Terminate() or SendSignal() messages to the original instance, not to a second instance that has taken over the same well-known bus name with `s-r-launcher-service --replace`. Similarly, we must listen for ProcessExited signals from the original instance, not a replacement. We can achieve this by resolving the well-known bus name (analogous to a DNS name) to a unique name (analogous to a dynamic IP address, but more so, since it is never reused during the lifetime of a dbus-daemon). Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This bug was inherited from flatpak-spawn. Forwarded: https://github.com/flatpak/flatpak-xdg-utils/pull/59 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Apr 07, 2022
-
-
Simon McVittie authored
Recent Meson versions have warnings if you add the subprojects directory as an include path, because the way Meson wants to consume subprojects is by the subproject's build system producing a Meson dependency object that encapsulates its include directory. libglnx seems to be set up to have the libglnx directory be its include path instead: for example, ostree (by the author of libglnx) already uses "libglnx.h" or <libglnx.h> everywhere. Do the same here. Flatpak equivalent: https://github.com/flatpak/flatpak/pull/4842 Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Mar 31, 2022
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
The names were confusingly similar, but _srt_util_set_up_logging() was actually orthogonal to pv_set_up_logging(): the former was about the disposition of the stdout and stderr fds, whereas the latter was about the GLib log handler. Rename it to make the difference clearer. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Feb 22, 2022
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jan 27, 2022
-
-
Simon McVittie authored
We wrote this, so it's fine to relicense it more permissively, from LGPL to MIT. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Nov 08, 2021
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Aug 03, 2021
-
-
Simon McVittie authored
Equivalent to <https://github.com/flatpak/flatpak-xdg-utils/pull/54 > in flatpak-spawn. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jun 10, 2021
-
-
Ludovico de Nittis authored
This commit addresses most of the warnings printed at compilation time while using clang and `ninja scan-build`. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- May 20, 2021
-
-
Ludovico de Nittis authored
Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Apr 14, 2021
-
-
Simon McVittie authored
Now that the ability to specify a custom path for /usr and /app has been merged into Flatpak git master, we can mostly assume that if the user has a git snapshot of Flatpak, they have that feature available. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Apr 12, 2021
-
-
Ludovico de Nittis authored
Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
- Feb 26, 2021
-
-
Simon McVittie authored
These are the client side for <https://github.com/flatpak/flatpak/pull/4018 >. We'll use them to put the Steam Runtime on /usr and an empty directory on /app. Because the corresponding Flatpak change has not been merged, make it fail unless an undocumented environment variable has been set. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
These indicate which lines are harmless and which lines are really bad, without taking up too much space. The mapping from GLib log level to message is not 100% obvious, because G_LOG_LEVEL_ERROR is "worse than" an error. We diagnose "can't happen" situations (assertion failures, etc.) as "Internal error". Ideally, users should never see these: they indicate a bug. For situations that will cause pressure-vessel to exit with an error, introduce a new log level flag PV_LOG_LEVEL_FAILURE and map it to the apt-style "E:" prefix. pv_log_failure() is a convenience macro to log at level PV_LOG_LEVEL_FAILURE. Conceptually this is a fatal error, but it's a fatal error prompted by something external to pressure-vessel, for which we want pressure-vessel to clean up "nicely" and exit gracefully, even though it's going to fail - so we can't use g_error() for this. In the parts of main() that involve parsing command-line arguments, add usage_error() as syntactic sugar for pv_log_failure(). I might eventually turn these into G_OPTION_ERROR_FAILED as we factor out more of main() into helper functions, but for now they're handled separately. For less-severe log levels, use single-letter prefixes similar to apt's. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Feb 16, 2021
-
-
Simon McVittie authored
We'll need this if we want to put a Flatpak subsandbox in our process ID namespace, so that Steam and the game can use process-ID-based IPC. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This was added in Flatpak 1.10.0. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- Jan 05, 2021
-
-
Ludovico de Nittis authored
Now that we have the ability to set the log level to "info", this commit promotes, from the debug level, all the messages that can be useful to have, for debugging purposes, but that are not too lousy. Over time, when we also gain more first hand experience with the issue reports that users provide, we can tweak the log messages even more. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
Ludovico de Nittis authored
This is the middle ground between the base logging and the verbose option. Currently we are not logging any messages at the info level, but we might start to do that. And this option gives us more granularity about how much logging we want to print. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-
Ludovico de Nittis authored
Moving this log function to "utils" allows us to avoid a lot of duplication. Signed-off-by:
Ludovico de Nittis <ludovico.denittis@collabora.com>
-