Skip to content

Commit

Permalink
host-exec: setup XDG_RUNTIME_DIR after download prompt, fix installat…
Browse files Browse the repository at this point in the history
…ion in init

Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Sep 18, 2023
1 parent 57d2607 commit b3e218a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions distrobox-host-exec
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,6 @@ elif command -v wget > /dev/null 2>&1; then
download_command="wget -qO"
fi

# This makes host-spawn work on initful containers, where the dbus session is
# separate from the host, we point the dbus session straight to the host's socket
# in order to talk with the org.freedesktop.Flatpak.Development.HostCommand on the host
XDG_RUNTIME_DIR="/run/host/${XDG_RUNTIME_DIR}"
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/host/$(echo "${DBUS_SESSION_BUS_ADDRESS}" | cut -d '=' -f2-)"

# Setup host-spawn as a way to execute commands back on the host
if ! command -v host-spawn > /dev/null ||
[ "$(printf "%s\n%s\n" "${host_spawn_version}" "$(host-spawn --version)" |
Expand Down Expand Up @@ -189,6 +183,12 @@ if ! command -v host-spawn > /dev/null ||

fi

# This makes host-spawn work on initful containers, where the dbus session is
# separate from the host, we point the dbus session straight to the host's socket
# in order to talk with the org.freedesktop.Flatpak.Development.HostCommand on the host
XDG_RUNTIME_DIR="/run/host/${XDG_RUNTIME_DIR}"
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/host/$(echo "${DBUS_SESSION_BUS_ADDRESS}" | cut -d '=' -f2-)"

###
# This workaround is needed because of a bug in gio (used by xdg-open) where
# a race condition happens when allocating a pty, leading to the command
Expand Down

0 comments on commit b3e218a

Please sign in to comment.