Connecting dbus to web app - Access environmental vars from browser

Curtis Maloney cmaloney at cardgate.net
Tue Jun 2 17:04:09 PDT 2009


pete-c wrote:
> However, I still have an error connecting to dbus. In the apache error log,
> it complains that the X11 initialisation failed, and I have discovered that
> setting either $DISPLAY or $DBUS_SESSION_BUS_ADDRESS solves this, so that
> running the cgi script in command line will work. The problem is I don't
> know how to make these variables accessible to the browser. Does anyone have
> an idea as to how I can solve this?

If you're trying to access a Session bus, you need some way to discover the 
session bus address.  Using the System bus does not have this issue (it has 
others:)

There is an apache module that will let you set env vars, but I doubt it 
would be able to access the data you need (the session bus address).  In my 
script, I read the current address from a file and stuff that into the env 
var.  Certainly less than ideal, but workable for now (I've only recently 
started using Session buses ).

-- 
Curtis Maloney
cmaloney at cardgate.net



More information about the dbus mailing list