[PATCH 5/5] activation: implement upstart activation

Scott James Remnant scott at netsplit.com
Thu Dec 23 14:46:44 PST 2010


On Thu, Dec 23, 2010 at 11:40 AM, Lennart Poettering <mzqohf at 0pointer.de> wrote:
> On Wed, 22.12.10 15:27, Scott James Remnant (scott at netsplit.com) wrote:
>
>> +      /* 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.
>
Good catch, you're quite right.  There's a period between D-Bus being
started and Upstart being connected to it, isn't there.  Now I get why
the systemd case has the ability to "activate" systemd, you're just
using that as a way to make D-Bus queue the signal and wait.

>> +          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?
>
Correct, an event is always successfully accepted by Upstart.  I
realised I missed out the (needless) dbus_message_set_no_reply
(message) - I should put that in for completeness sake.

Scott


More information about the dbus mailing list