Skip to content

Bring back gio-launch-desktop, use it to redirect stdout/stderr to the Journal

  • !2818 (merged)

  • Revert "gdesktopappinfo: Use sh rather than gio-launch-desktop"

    A shell one-liner was enough to set GIO_LAUNCHED_DESKTOP_FILE_PID, but ideally we also want to do the equivalent of sd_journal_stream_fd() to set up its standard output and standard error streams.

    Ideally we would call sd_journal_stream_fd() in a process that will exec the real program, otherwise it will report the wrong process ID in the Journal, but we can't easily do that in a forked child when using posix_spawn() for subprocesses.

    This reverts commit 2b533ca9.

  • tests: Avoid using deprecated meson.build_root

  • gio-launch-desktop: Add SPDX-License-Identifier

  • gio-launch-desktop: Fix a compiler warning

  • gdesktopappinfo: Don't trust $GIO_LAUNCH_DESKTOP if setuid

    gio-launch-desktop was removed before checking GIO for potentially unsafe environment variable references, so reverting its removal brought this one back. If a setuid program is using GAppInfo then something is probably already horribly wrong, but let's be careful anyway.

  • Install gio-launch-desktop in a non-PATH location

    This is an internal helper executable, which users shouldn't invoke directly (see #1633 (closed)).

    When building for a single-architecture distribution, we can install it as ${libexecdir}/gio-launch-desktop.

    When building for a multiarch distribution, installing it into an architecture-specific location and packaging it alongside the GLib library avoids the problem discussed in #1633 (closed) where it would either cause a circular dependency between the GLib library and a common cross-architecture package (libglib2.0-bin in Debian), or require a separate package just to contain gio-launch-desktop, or cause different architectures' copies to overwrite each other.

  • gio-launch-desktop: Redirect stdout, stderr to systemd Journal

    This prevents a launched process's output from being mixed up with the output of the parent process, which can lead to the wrong program being blamed for warning messages.

and optionally (these last two are easy to drop if not wanted):

  • gmessages: Factor out _g_fd_is_journal into its own translation unit

    I want to use this in gio-launch-desktop, but gio-launch-desktop doesn't depend on GLib, so I can't just call g_log_writer_is_journald().

  • gio-launch-desktop: Don't alter stdout/stderr if not already the Journal

Resolves #2682 (closed)

Edited by Simon McVittie

Merge request reports

Loading