Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export DBUS_SESSION_BUS_ADDRESS

Tags:

linux

yocto

dbus

I'm trying to run D-Bus on an embedded system (Yocto Linux) and connect to it from my application code.

I get the following error when I call dbus_bus_get(DBUS_BUS_SESSION, &err);

Using X11 for dbus-daemon autolaunch was disabled 
at compile time, set your DBUS_SESSION_BUS_ADDRESS 
instead

I realize that I need to start the dbus-daemon first so I have run dbus-launch from the command line.

This prints out a value of DBUS_SESSION_BUS_ADDRESS but how could I export it programmatically?

like image 691
User55412 Avatar asked Dec 20 '16 12:12

User55412


2 Answers

Type the following command into a terminal:

eval `dbus-launch --auto-syntax`
like image 79
Mostafa Aghashahi Avatar answered Sep 23 '22 17:09

Mostafa Aghashahi


I've finally found the answer, running the following command exports the output of dbus-launch:

export $(dbus-launch)
like image 26
User55412 Avatar answered Sep 19 '22 17:09

User55412