Unlocking device(s) on process exit/crash

Dan Williams dcbw at redhat.com
Wed Jun 8 13:20:45 PDT 2005


On Wed, 8 Jun 2005, David Zeuthen wrote:

> On Wed, 2005-06-08 at 13:47 -0400, Clark, Chris M wrote:
> > Thanks for everyone's responses to my mail. The problem occurs for 
> > both Python exceptions and the "kill -9" scenario.
> > 
> > It sounds like I'm suposed to deal with the exceptions (which I 
> > already do with a "finally" block which performs the Unlock). The 
> > example I posted had a simplistic "catch" way of dealing this this 
> > (but it was disabled for demo purposes).
> > 
> > For the "kill -9" scenario it sounds like I've hit a bug, that 
> > none else is seeing (thank you to David Zeuthen for testing a 
> > slightly different combination that indicated there may a problem 
> > with the Ubuntu/0.23 dbus bindings). I'll log a report with Ubuntu 
> > bug tracker and see how things go from them.
> 
> Looking at the NEWS file for D-BUS 0.23 one change from 0.22 is this
> 
>  - use SerivceOwnerChanges signal instead of ServiceCreated and
>    ServiceDeleted
> 
> so I think we need a patch for hal 0.4.x such that we look for
> "SerivceOwnerChanged" signals instead of "ServiceCreated" and
> "ServiceDeleted" but only if we use D-BUS >= 0.23. Anyone care to cook
> up such a patch? :-)

I had code for this in earlier releases of NetworkManager.  See for example:

http://cvs.gnome.org/viewcvs/NetworkManager/libnm_glib/libnm_glib.c?rev=1.5&only_with_tag=STABLE_0_3&view=markup

And search for "ServiceOwnerChanged".  Replace the NM_DBUS_SERVICE with the dbus 
service name of your choice, and it should work for you.  5 minutes tops :)  You 
don't even need the #if/#elif stuff I have in there since its just a signal 
name.

Dan
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list