Unlocking device(s) on process exit/crash

Joe Shaw joeshaw at novell.com
Mon Jun 6 13:49:14 PDT 2005


Hi,

On Sun, 2005-06-05 at 14:10 -0400, Clark, Chris M wrote:
> I'm trying to create an application that monitors cdrom insertions and
> then "do something" (the "something" is an audio cd cataloging program
> http://yacddb.sf.net). I'd like to have sole access to the drives to
> prevent audio cd players, etc. interfering. I've gone through the
> mailing lists and come up with some code to determine the cdrom
> capable devices, lock them, detect media inserted, and finally unlock
> the devices when I'm done. The problem I'm facing is that if my
> application crashes/is-killed the locks are still left in hal.

HAL is supposed to release the locks if the D-BUS connection from your
application is lost.  If it's not doing this, it's probably a bug.  Is
your app dying because of a python exception (which wouldn't cause the
connection to die), or some other reason?  If you kill -9 it, the lock
should definitely be released.

Joe

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



More information about the Hal mailing list