Merge pull request #120222 from pennae/libreoffice-dbus

libreoffice: kill private dbus instance on exit
This commit is contained in:
Michael Raskin 2021-04-23 08:50:35 +00:00 committed by GitHub
commit d2d3068328
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ if uname | grep Linux > /dev/null &&
fi fi
dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")" 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 & "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session" &> /dev/null &
dbus_pid=$!
export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session" export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
fi fi
@ -27,5 +28,5 @@ done
"@libreoffice@/bin/$(basename "$0")" "$@" "@libreoffice@/bin/$(basename "$0")" "$@"
code="$?" code="$?"
test -n "$dbus_socket_dir" && rm -rf "$dbus_socket_dir" test -n "$dbus_socket_dir" && { rm -rf "$dbus_socket_dir"; kill $dbus_pid; }
exit "$code" exit "$code"