Exposing dbus interface and using it inside the same snap

Sergey Borovkov serge.borovkov at gmail.com
Fri Feb 10 17:35:09 UTC 2017


Hi, I've been struggling with getting dbus interface exposed. I am getting
this error during runtime:
GLib.Error: g-dbus-error-quark:
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:
Connection ":1.1160" is not allowed to own the service
"com.screenly.playlist" due to security policies in the configuration file
(9)

jdstrand helped me on IRC, and told me I need to have a slot and a plug in
my snap. I am doing something wrong though, can someone help out with how
it's correctly supposed to be used?

apps:
  playlist:
    command: usr/bin/playlist-service.sh
    daemon: simple
    plugs: [network-bind, network, playlist-dbus]

  websocket:
    command: usr/bin/websocket-service.sh
    daemon: simple
    plugs: [network-bind, network, dbus]
    slots: [websocket-dbus]

slots:
  playlist-dbus:
    interface: dbus
    name: com.screenly
    bus: system

plugs:
  websocket-dbus:
    interface: dbus
    name: com.screenly
    bus: system
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170210/5eafa05e/attachment.html>


More information about the Snapcraft mailing list