#include "activation.h"
#include "connection.h"
#include "containers.h"
+#include "dispatch.h"
#include "services.h"
#include "utils.h"
#include "policy.h"
return _dbus_uuid_encode (&context->uuid, uuid);
}
+/**
+ * Send signal to the buses that the activatable services may be changed
+ *
+ * @param context bus context to use
+ * @param error the error to set, if NULL no error will be set
+ * @return #FALSE if an error occurred, the reason is returned in \p error
+ */
+static dbus_bool_t
+bus_context_send_activatable_services_changed (BusContext *context,
+ DBusError *error)
+{
+ DBusMessage *message;
+ BusTransaction *transaction;
+ dbus_bool_t retval = FALSE;
+
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ transaction = bus_transaction_new (context);
+ if (transaction == NULL)
+ {
+ BUS_SET_OOM (error);
+ return FALSE;
+ }
+
+ message = dbus_message_new_signal (DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS,
+ "ActivatableServicesChanged");
+
+ if (message == NULL)
+ {
+ BUS_SET_OOM (error);
+ goto out;
+ }
+
+ if (!dbus_message_set_sender (message, DBUS_SERVICE_DBUS))
+ {
+ BUS_SET_OOM (error);
+ goto out;
+ }
+
+ if (!bus_transaction_capture (transaction, NULL, NULL, message))
+ {
+ BUS_SET_OOM (error);
+ goto out;
+ }
+
+ retval = bus_dispatch_matches (transaction, NULL, NULL, message, error);
+
+out:
+ if (transaction != NULL)
+ {
+ if (retval)
+ bus_transaction_execute_and_free (transaction);
+ else
+ bus_transaction_cancel_and_free (transaction);
+ }
+ dbus_clear_message (&message);
+ return retval;
+}
+
dbus_bool_t
bus_context_reload_config (BusContext *context,
DBusError *error)
if (parser != NULL)
bus_config_parser_unref (parser);
+ {
+ DBusError local_error = DBUS_ERROR_INIT;
+
+ if (!bus_context_send_activatable_services_changed (context, &local_error))
+ bus_context_log (context, DBUS_SYSTEM_LOG_INFO, "Unable to send signal that configuration has been reloaded: %s", local_error.message);
+
+ dbus_error_free (&local_error);
+ }
+
_dbus_daemon_report_reloaded ();
return ret;
}
" </signal>\n"
" <signal name=\"NameAcquired\">\n"
" <arg type=\"s\"/>\n"
+ " </signal>\n"
+ " <signal name=\"ActivatableServicesChanged\">\n"
" </signal>\n",
/* Not in the Interfaces property because if you can get the properties
* of the o.fd.DBus interface, then you certainly have the o.fd.DBus
&arr_iter))
return FALSE;
+ s = "ActivatableServicesChanged";
+
+ if (!dbus_message_iter_append_basic (&arr_iter, DBUS_TYPE_STRING, &s))
+ goto abandon;
+
+
if (bus_apparmor_enabled ())
{
s = "AppArmor";