<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>Hi,</div>
<div> </div>
<div>I’m using QtDBus in my daemon (systemd service), and I can register my own service on systemBus, and also can connect to systembus signals.</div>
<div>When starting executable from command line it runs ok and connects also to the sessionbus signals successfully.</div>
<div>but when it is started via systemctl start I can’t connect to sessionbus signals.</div>
<div> </div>
<div>It throws following error:  “<font face="Arial" size="1"><span style="font-size:8pt;">Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead</span></font><font face="Arial" size="1"><span style="font-size:8pt;">”</span></font></div>
<div> </div>
<div>this is printed from code below:</div>
<div> </div>
<div><font face="Courier New" size="2" color="olive"><span style="font-size:10pt;"> if<font color="silver"> </font><font color="black">(!</font><font color="purple">QDBusConnection</font><font color="black">::sessionBus().isConnected())</font></span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;"> {</span></font></div>
<div><font face="Courier New" size="2" color="silver"><span style="font-size:10pt;">    <font color="black">writeToLog(</font><font color="navy">qPrintable</font><font color="black">(</font><font color="purple">QDBusConnection</font><font color="black">::sessionBus().lastError().message()));</font></span></font></div>
<div><font face="Courier New" size="2" color="silver"><span style="font-size:10pt;">    <font color="black">exit(</font><font color="navy">EXIT_FAILURE</font><font color="black">);</font></span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;"> }</span></font></div>
<div> </div>
<div>I figured out that <font face="Arial" size="1"><span style="font-size:8pt;">DBUS_SESSION_BUS_ADDRESS</span></font>  is an environment variable which obviously is not visible in this context.</div>
<div> </div>
<div>is there a way to pass this to the systemd service??</div>
<div> </div>
<div>regards,</div>
<div>Kimmo</div>
<div> </div>
</span></font>
</body>
</html>