activation and shutdown

Randell Jesup rjesup at
Thu Nov 5 07:45:47 PST 2009

>On Thu, 2009-11-05 at 10:56 +0100, Kees Jongenburger wrote:
>> Hi
>> I am making use of DBus activation to launch processes when needed.
>> Overall I followed Raphaël Slinckx tutorial that can be found here
>> Next to activation I also would like my application to shutdown when
>> "done". How is this best done? I am mainly worried about
>> synchronization issues for example
>> what happens if I decide to  shutdown my service but at the same time
>> somebody calls on me? will activation take this into account?
>> The most simple way I can shutdown now is to simply stop running after
>> one method is served will that work?
>In fprintd (and a number of other daemons), we exit 30 seconds after the
>last client has exited.

That's not sufficient to guarantee that you won't get a message right as
you shut down - just reduces the odds.  There's an inherent timing
window from when a device decides to shut down and when it finishes
deregistering from the bus - if someone sends a method to you then,
unless you're very careful you may not process the message.  I'm not
sure how dbus handles this race condition.

Randell Jesup, Worldgate
rjesup at

More information about the dbus mailing list