From 79d4fc9045c2453f7175efa2af570a3b2ad98454 Mon Sep 17 00:00:00 2001 From: segfault Date: Fri, 19 Apr 2024 15:39:06 +0200 Subject: [PATCH] housekeeping: Fix systemd OOM notifications Systemd doesn't send the PropertiesChanged signal unless the org.freedesktop.systemd1.Manager.Subscribe() method is called. See: https://github.com/systemd/systemd/pull/36413 https://github.com/systemd/systemd/pull/36366 Closes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/790 --- plugins/housekeeping/gsd-systemd-notify.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/housekeeping/gsd-systemd-notify.c b/plugins/housekeeping/gsd-systemd-notify.c index 8519d4e9d..975a3fe65 100644 --- a/plugins/housekeeping/gsd-systemd-notify.c +++ b/plugins/housekeeping/gsd-systemd-notify.c @@ -205,6 +205,23 @@ on_bus_gotten (GDBusConnection *obj, } self->session = con; + + /* Subscribe to systemd events by calling Subscribe on + * org.freedesktop.systemd1.Manager. + */ + g_dbus_connection_call (self->session, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "Subscribe", + NULL, + G_VARIANT_TYPE ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + NULL, + NULL); + self->sub_service = g_dbus_connection_signal_subscribe (self->session, "org.freedesktop.systemd1", "org.freedesktop.DBus.Properties", -- GitLab