Using D-Bus To Start Apps

John (J5) Palmieri johnp at
Mon Feb 25 10:15:57 PST 2008

On Mon, 2008-02-25 at 04:23 -0800, Thanh Tran wrote:
> I would like to use the D-Bus and HAL service to start
> specific apps.  I plan to write a service wich reads
> the D-Bus and looks for specific messages from the HAL
> service.  For example, HAL reports a USB CD ROM drive
> has been recently attached by the user.  My service
> would read the D-Bus and start another application
> based on the device detected.  I think I can create my
> service using the D-Bus C API.  However, is there an
> easier way?  Is writing a separate service over-kill? Thanks.

It depends what you want to do.  Hal already has the ability to run
scripts as root based off of matches.  If you are running something in
the user's session then look at gnome-volume-manager which exec's
programs based on hotplug events from HAL.  You can also use D-Bus
activation which only works in the session currently but the Beta
releases of the new D-Bus support system activation.

John (J5) Palmieri <johnp at>

More information about the dbus mailing list