Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 862
    • Issues 862
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 39
    • Merge requests 39
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2819

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Simon McVittie requested to merge smcv/glib:wip/smcv/gio-launch-desktop-sd-journal into main Jul 14, 2022
  • Overview 14
  • Commits 9
  • Pipelines 5
  • Changes 9
  • !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 Jul 24, 2022 by Simon McVittie
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/smcv/gio-launch-desktop-sd-journal