summary refs log tree commit diff
path: root/pkgs/applications/office/libreoffice
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2019-03-23 12:16:02 +0100
committerMichael Raskin <7c6f434c@mail.ru>2019-03-23 12:16:53 +0100
commitb8ed97001e44a16e48f57a07a4eb50344ee357a6 (patch)
tree7af3420cab0af0e7f00525cd852c8d79c9eb90dd /pkgs/applications/office/libreoffice
parent239f5e8376c146aee5a0b2922d0a55b165963c5c (diff)
downloadnixpkgs-b8ed97001e44a16e48f57a07a4eb50344ee357a6.tar
nixpkgs-b8ed97001e44a16e48f57a07a4eb50344ee357a6.tar.gz
nixpkgs-b8ed97001e44a16e48f57a07a4eb50344ee357a6.tar.bz2
nixpkgs-b8ed97001e44a16e48f57a07a4eb50344ee357a6.tar.lz
nixpkgs-b8ed97001e44a16e48f57a07a4eb50344ee357a6.tar.xz
nixpkgs-b8ed97001e44a16e48f57a07a4eb50344ee357a6.tar.zst
nixpkgs-b8ed97001e44a16e48f57a07a4eb50344ee357a6.zip
libreoffice: wrapper: fallback to /tmp if /run is not usable
Diffstat (limited to 'pkgs/applications/office/libreoffice')
-rw-r--r--pkgs/applications/office/libreoffice/wrapper.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/applications/office/libreoffice/wrapper.sh b/pkgs/applications/office/libreoffice/wrapper.sh
index cff8f200e2b..62569734745 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"