<div dir="ltr">Hi<div><br></div><div>You should run your daemon form user systemd unit.</div><div><a href="https://wiki.archlinux.org/index.php/Systemd/User">https://wiki.archlinux.org/index.php/Systemd/User</a><br></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On 1 February 2014 21:53, Kimmo Lindholm <span dir="ltr"><<a href="mailto:Kimmo.Lindholm@eke.fi" target="_blank">Kimmo.Lindholm@eke.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div>
<font face="Calibri"><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" 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"><span style="font-size:10pt"> {</span></font></div>
<div><font face="Courier New" 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" 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"><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>
</div>

<br>_______________________________________________<br>
SailfishOS.org Devel mailing list<br></blockquote></div><br></div>