Issues using dbus in strict
knitzsche
kyle.nitzsche at canonical.com
Mon Apr 3 13:07:43 UTC 2017
Hi Jamie,
Do you have any input on this issue?
thanks
On 03/31/2017 10:55 AM, Sergey Borovkov wrote:
> Hi. I am running a couple of daemons (daemon: simple) and they interact
> between each other using dbus. Unfortunately I've ran into the issue when
> porting them from devmode to strict, I am getting this backtrace just
> trying to obtain SystemBus in python:
>
> Mar 31 12:44:02 localhost.localdomain snap[1466]: GLib.Error:
> g-io-error-quark: Could not connect: Permission denied (14)
> Mar 31 12:44:02 localhost.localdomain snap[1466]: return Gio.bus_get_sync(type,
> None).pydbus
> Mar 31 12:44:02 localhost.localdomain snap[1466]: File "/snap/screenly-
> client/165/lib/python3.5/site-packages/pydbus/bus.py", line 19, in bus_get
> Mar 31 12:44:02 localhost.localdomain snap[1466]: return bus_get(Bus.Type.
> SYSTEM)
> Mar 31 12:44:02 localhost.localdomain snap[1466]: File "/snap/screenly-
> client/165/lib/python3.5/site-packages/pydbus/bus.py", line 57, in SystemBus
> Mar 31 12:44:02 localhost.localdomain snap[1466]: self.bus = SystemBus()
> Mar 31 12:44:02 localhost.localdomain kernel: audit: type=1400
> audit(1490964242.523:72): apparmor="DENIED" operation="connect" profile=
> "snap.screenly-client.websocket" name="/run/dbus/system_bus_socket"
> pid=1466 comm="python3" req
> Mar 31 12:44:02 localhost.localdomain audit[1466]: AVC apparmor="DENIED"
> operation="connect" profile="snap.screenly-client.websocket" name="/
> run/dbus/system_bus_socket" pid=1466 comm="python3" requested_mask="wr"
> denied_mask="wr"
>
> I am not sure if I need to use some additional interfaces - to get it
> working under devmode I've used the following code (And I can't find
> anything relevant in wiki):
>
> playlist:
> command: usr/bin/playlist-service.sh
> daemon: simple
> plugs: [network-bind, network]
> slots: [playlist-dbus-server]
>
> websocket:
> command: usr/bin/websocket-service.sh
> daemon: simple
> plugs: [network-bind, network, playlist-dbus-client]
>
> slots:
> playlist-dbus-server:
> interface: dbus
> name: com.screenly.playlist
> bus: system
>
> plugs:
> playlist-dbus-client:
> interface: dbus
> name: com.screenly.playlist
> bus: system
>
More information about the Snapcraft
mailing list