From b8ed97001e44a16e48f57a07a4eb50344ee357a6 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 23 Mar 2019 12:16:02 +0100 Subject: [PATCH] libreoffice: wrapper: fallback to /tmp if /run is not usable --- pkgs/applications/office/libreoffice/wrapper.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/office/libreoffice/wrapper.sh b/pkgs/applications/office/libreoffice/wrapper.sh index cff8f200e2bc..62569734745c 100644 --- a/pkgs/applications/office/libreoffice/wrapper.sh +++ b/pkgs/applications/office/libreoffice/wrapper.sh @@ -5,7 +5,13 @@ export JAVA_HOME="${JAVA_HOME:-@jdk@}" if uname | grep Linux > /dev/null && ! ( test -n "$DBUS_SESSION_BUS_ADDRESS" ); then dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus" - mkdir "$dbus_tmp_dir" + if ! test -d "$dbus_tmp_dir" && test -d "/run"; then + mkdir -p "$dbus_tmp_dir" + fi + if ! test -d "$dbus_tmp_dir"; then + dbus_tmp_dir="/tmp/libreoffice-$(id -u)/libreoffice-dbus" + mkdir -p "$dbus_tmp_dir" + fi dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")" "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session" &> /dev/null & export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"