trying to use hald without libhal

John (J5) Palmieri johnp at
Wed Dec 22 07:44:11 PST 2004

On Wed, 2004-12-22 at 05:05 -0600, jorge luis zapata wrote:
> hi, i am making a simple dbus protocol lib, and is
> kind of usable but i am having problems to use the hal
> method calls. i can register to signals from the
> hal.manager but i cant call the methods like
> getproperty, or listdevices, looking for the errors in
> the dbus it says that i am not the owner for the
> service (i am not org.freedesktop.hal), but when i use
> the bin hal-get-property i am able to see the property
> of the device. so my question is, to be able to call
> this method calls (getproperty, setpropoerty,
> listdevices,listproperties,etc) i must use only the
> libhal functions? what are the steps to use hal
> (protocol steps)? do i have to call acquireservice for
> org.freedesktop.hal? (it also gave my errors trying to
> acquire it)
> thanks, bye.

You can't acquire the service because it is already acquired by Hal.
You can't own the Hal service.  

Here is the dbus policy for Hal:


  <!-- This configuration file specifies the required security policies
       for the HAL to work. -->

  <!-- Only root or user haldaemon can own the HAL service -->
  <policy user="haldaemon">
    <allow own="org.freedesktop.Hal"/>
  <policy user="root">
    <allow own="org.freedesktop.Hal"/>

  <!-- Allow anyone to invoke methods on the Manager and Device
interfaces -->
  <policy context="default">
    <allow send_interface="org.freedesktop.Hal.Manager"/>
    <allow send_interface="org.freedesktop.Hal.Device"/>

    <allow receive_interface="org.freedesktop.Hal.Manager"
    <allow receive_interface="org.freedesktop.Hal.Device"


Only root or the haldaemon user can own the service but anyone can
invoke methods on the Manager and Device interfaces.  It looks like you
might be sending to org.freedesktop.Hal and not
org.freedesktop.Hal.Manager or org.freedesktop.Hal.Device.  Those are
the interfaces you need to use.  Also take a peek into the libhal code
to see how it does things.

John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.

hal mailing list
hal at

More information about the Hal mailing list