<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Thank you Jamie, </div><div><br></div><div>those links are very helpful and I was able to do some progress with my snaps. </div><div>On snappy vm (amd64) my framework snap installs and registers on dbus, I can also see dbus config generated for it.</div><div><br></div><div>But today I was doing more tests on RPi2 image (latest, 15 Apr build) and I got permission error after snap install. I have tried the <i>package-dir-fwk</i> example but got the same error:</div><div><br></div><div><div>Jun  1 17:39:09 localhost kernel: [ 3787.848606] audit: type=1400 audit(1433180349.509:13): apparmor="STATUS" operation="profile_load" profile="unconfined" name="hello-dbus-fwk_srv_1.0.0" pid=1786 comm="apparmor_parser"</div><div>Jun  1 17:39:09 localhost systemd[1]: Reloading.</div><div>Jun  1 17:39:09 localhost systemd[1]: Started hello-dbus-fwk test service.</div><div>Jun  1 17:39:09 localhost systemd[1]: Starting hello-dbus-fwk test service...</div><div>Jun  1 17:39:09 localhost dbus_service.start[1803]: FAIL: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.26" is not allowed to own the service "com.canonical.hello-dbus-fwk" due to security policies in the configuration file</div><div>Jun  1 17:39:10 localhost systemd[1]: hello-dbus-fwk_srv_1.0.0.service: main process exited, code=exited, status=1/FAILURE</div><div>Jun  1 17:39:10 localhost systemd[1]: Unit hello-dbus-fwk_srv_1.0.0.service entered failed state.</div><div>Jun  1 17:39:10 localhost systemd[1]: hello-dbus-fwk_srv_1.0.0.service failed.</div><div><br></div></div><div>I am using last version of snappy-tools while building snap. </div><div>Is there something I'm missing? </div><div><br></div><div>Below is my system info:</div><div><br></div><div><div>(RaspberryPi2)ubuntu@localhost:~$ sudo snappy list</div><div>Name           Date       Version Developer</div><div>ubuntu-core    2015-04-10 4</div><div>hello-dbus-fwk 2015-06-01 1.0.0</div><div>pi2            2015-04-15 0.11    lool</div><div><br></div><div>(RaspberryPi2)ubuntu@localhostlsb_release -a</div><div>No LSB modules are available.</div><div>Distributor ID: Ubuntu</div><div>Description:    Ubuntu Vivid Vervet (development branch)</div><div>Release:        15.04</div><div>Codename:       vivid</div></div><div><br></div><div><br></div><div><br></div><div>-Sergey </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">---------- Forwarded message ----------<br>From: Jamie Strandboge <<a href="mailto:jamie@canonical.com">jamie@canonical.com</a>><br>To: <a href="mailto:snappy-devel@lists.ubuntu.com">snappy-devel@lists.ubuntu.com</a><br>Cc: <br>Date: Fri, 29 May 2015 12:31:01 -0500<br>Subject: Re: Dbus system config for framework and app snaps<br>On 05/29/2015 10:29 AM, Sergey Demyanov wrote:<br>
> Hi everyone,<br>
><br>
><br>
> I wanted to reiterate question on the way snap developers would configure dbus<br>
> permissions if needed. Since we have to use System bus for snaps by default we<br>
> cannot own and register objects on the bus.<br>
> As of now the only way is to copy own .config file<br>
> into /etc/dbus-1/system.d/ but in recent builds that partition is read only and<br>
> remounting seems like a big hack.<br>
> May be it is possible to allow some namespace prefix for snaps to own or include<br>
> config into snap package and make snappy apply it during install?<br>
><br>
> Should I open bug for this or first discuss here the way to do it?<br>
<br>
This was implemented just before 15.04 was released via 'bus-name' in the<br>
package.yaml for frameworks[1]. Under the hood, when a framework snap service<br>
specifies 'bus-name', snappy will update the system service to include BusName=<br>
and Type=dbus and snappy will also create simple bus policy in<br>
/etc/dbus-1/system.d. You can see 'hello-dbus' from the snappy-examples[2] for a<br>
working example, or install them on your system:<br>
<br>
$ sudo snappy install hello-dbus-fwk<br>
$ sudo snappy install hello-dbus-app<br>
$ hello-dbus-app.client<br>
PASS<br>
<br>
[1]<a href="https://developer.ubuntu.com/en/snappy/guides/frameworks/" target="_blank">https://developer.ubuntu.com/en/snappy/guides/frameworks/</a><br>
[2]<a href="http://bazaar.launchpad.net/~snappy-dev/snappy-hub/snappy-examples/files/head:/hello-dbus/" target="_blank">http://bazaar.launchpad.net/~snappy-dev/snappy-hub/snappy-examples/files/head:/hello-dbus/</a><br>
<br>
--<br>
Jamie Strandboge                 <a href="http://www.ubuntu.com/" target="_blank">http://www.ubuntu.com/</a><br></blockquote></div>
</div></div>