[PATCH 5/5] activation: implement upstart activation

Lennart Poettering mzqohf at 0pointer.de
Thu Dec 23 03:40:15 PST 2010


On Wed, 22.12.10 15:27, Scott James Remnant (scott at netsplit.com) wrote:

> Upstart activation is performed by emitting a dbus-activation event
> within Upstart, and then simply expecting the appropriate bus name
> to appear.  e.g.
> 
> 	start on dbus-activation org.freedesktop.UDisks
> 	exec /usr/lib/udisks/udsks-daemon
> ---
>  bus/activation.c |  170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 170 insertions(+), 0 deletions(-)
> 
> diff --git a/bus/activation.c b/bus/activation.c
> index 978fa00..198d6bf 100644
> --- a/bus/activation.c
> +++ b/bus/activation.c
> @@ -1918,6 +1918,176 @@ bus_activation_activate_service (BusActivation  *activation,
>    if (activated)
>      return TRUE;
>  
> +  if (bus_context_get_activation_type (activation->context) == ACTIVATION_UPSTART)
> +    {
> +      BusRegistry *registry;
> +      DBusString service_string;
> +      BusService *service;
> +
> +      /* Check whether Upstart is connected */
> +      registry = bus_connection_get_registry (connection);
> +      _dbus_string_init_const (&service_string, "com.ubuntu.Upstart");
> +      service = bus_registry_lookup (registry, &service_string);

I am pretty sure that this is racy.

> +          retval = bus_dispatch_matches (activation_transaction, NULL, bus_service_get_primary_owners_connection (service),
> +                                           message, error);


Am I missing something or is there no error path back?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the dbus mailing list