hi all<div>     I need a systembus for example, the dbus-python haven&#39;t supply. So I want to create a systembus myself,</div><div>the example I based on example-services.py under the dbus-python-0.83.1/examples which  is python-dbus source code directory.</div>
<div>I do below step, and grab a failed:</div><div>1. modify example-services.py session_bus = dbus.SessionBus() to   session_bus = dbus.SystemBus().</div><div>2.create  /usr/share/dbus-1/system-services/com.example.SampleService.service </div>
<div><div>[D-BUS Service]</div><div>Name=com.example.SampleService</div><div>Exec=/opt/examples/example-service.py</div><div>User=root</div></div><div>3.create /etc/dbus-1/system.d/com.example.SampleService.conf </div><div>
<div>&lt;!DOCTYPE busconfig PUBLIC</div><div> &quot;-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN&quot;</div><div> &quot;<a href="http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd</a>&quot;&gt;</div>
<div>&lt;busconfig&gt;</div><div>  &lt;!-- Only root could launch this service --&gt;</div><div>  &lt;policy user=&quot;root&quot;&gt;</div><div>    &lt;allow own=&quot;com.example.SampleService&quot;/&gt;</div><div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;/&gt;</div>
<div>    &lt;allow send_interface=&quot;com.example.SampleService&quot;/&gt;</div><div>    &lt;allow send_member=&quot;com.example.SampleService&quot;/&gt;</div><div>  &lt;/policy&gt;</div><div> </div><div>  &lt;policy context=&quot;default&quot;&gt;</div>
<div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;</div><div>           send_interface=&quot;org.freedesktop.DBus.Introspectable&quot;/&gt;</div><div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;</div>
<div>           send_member=&quot;RaiseException&quot;/&gt;</div><div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;</div><div>           send_member=&quot;HelloWorld&quot;/&gt;</div><div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;</div>
<div>           send_member=&quot;GetTuple&quot;/&gt;</div><div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;</div><div>           send_member=&quot;GetDict&quot;/&gt;</div><div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;</div>
<div>           send_member=&quot;Exit&quot;/&gt;</div><div>    &lt;allow send_destination=&quot;com.example.SampleService&quot;</div><div>           send_member=&quot;RaiseException&quot;/&gt;</div><div>  &lt;/policy&gt;</div>
<div>&lt;/busconfig&gt;</div></div><div> </div><div>After above step, I run example-service.py manual: ./example-service.py </div><div>Traceback (most recent call last):</div><div>  File &quot;./example-service.py&quot;, line 78, in &lt;module&gt;</div>
<div>    name = dbus.service.BusName(&quot;com.example.SampleService&quot;, session_bus)</div><div>  File &quot;/usr/lib/pymodules/python2.6/dbus/service.py&quot;, line 129, in __new__</div><div>    retval = bus.request_name(name, name_flags)</div>
<div>  File &quot;/usr/lib/pymodules/python2.6/dbus/bus.py&quot;, line 306, in request_name</div><div>    &#39;su&#39;, (name, flags))</div><div>  File &quot;/usr/lib/pymodules/python2.6/dbus/connection.py&quot;, line 630, in call_blocking</div>
<div>    message, timeout)</div><div>dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Connection &quot;:1.48&quot; is not allowed to own the service &quot;com.example.SampleService&quot; due to security policies in the configuration file</div>
<div><br></div><div> Any ideas ?</div><div><div><div><br></div>--  <br><font color="#888888">Best Regards,<br>
Qin Bo<br></font><br>
</div></div>