QDBus - Cannot register Service name on System Bus
Hi,
How do I register service on to the System Bus.
if(!dbus.registerService("org.archlinux.myservice"))
qDebug() << "Failed to register alias Service on DBus";
The connection happens correctly and everything works, the only trouble is that I can't register a service. Calling that on the session Bus works as expected, but the system Bus simply refuses to register it.
Am I doing something wrong?
There is an old thread on the same issue, but no solution given
Re: QDBus - Cannot register Service name on System Bus
I have the same issue that you do with the System Bus.
Have you found a solution?
Re: QDBus - Cannot register Service name on System Bus
Old post but I was stuck with the same problem, so for anyone else interested the solution is you need to create a DBus policy conf.
For example:
/etc/dbus-1/system.d/org.kde.foohelper.conf
[CODE]<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only user root can own the foo helper -->
<policy user="root">
<allow own="org.kde.foohelper"/>
</policy>
<!-- Allow anyone to call into the service - we'll reject callers using PolicyKit -->
<policy context="default">
<allow send_interface="org.kde.foohelper"/>
<allow receive_sender="org.kde.foohelper"/>
<allow receive_interface="org.kde.foohelper"/>
</policy>
</busconfig>
[/CODE]
[url]http://techbase.kde.org/Development/Tutorials/PolicyKit/Helper_HowTo#The_DBus_policy_file[/url]
[url]http://dbus.freedesktop.org/doc/dbus-daemon.1.html#lbAF[/url]