mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-28 03:45:10 -04:00
dir: Reload DBus daemon config to ensure services get picked up
This is best effort. There is a 2s timeout and if something fails everything continues on. This is called from flatpak_dir_run_triggers because it gets called whenever we might have changes to the exported service files. Fixes #3342 Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
This commit is contained in:
committed by
Simon McVittie
parent
56438bf542
commit
9532c8d333
@@ -7057,6 +7057,28 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
maybe_reload_dbus_config (GCancellable *cancellable)
|
||||
{
|
||||
g_autoptr(GDBusConnection) session_bus = NULL;
|
||||
|
||||
session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION, cancellable, NULL);
|
||||
if (!session_bus)
|
||||
return;
|
||||
|
||||
g_dbus_connection_call_sync (session_bus,
|
||||
"org.freedesktop.DBus",
|
||||
"/org/freedesktop/DBus",
|
||||
"org.freedesktop.DBus",
|
||||
"ReloadConfig",
|
||||
NULL,
|
||||
NULL,
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
2000,
|
||||
cancellable,
|
||||
NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
flatpak_dir_run_triggers (FlatpakDir *self,
|
||||
GCancellable *cancellable,
|
||||
@@ -7069,6 +7091,8 @@ flatpak_dir_run_triggers (FlatpakDir *self,
|
||||
GError *temp_error = NULL;
|
||||
const char *triggerspath;
|
||||
|
||||
maybe_reload_dbus_config (cancellable);
|
||||
|
||||
if (flatpak_dir_use_system_helper (self, NULL))
|
||||
{
|
||||
const char *installation = flatpak_dir_get_id (self);
|
||||
|
||||
Reference in New Issue
Block a user