IPC between snaps

Simon Fels simon.fels at canonical.com
Fri Feb 10 06:15:06 UTC 2017


On 09.02.2017 11:36, Roberto Mier Escandón  wrote:
> Thanks Löic.
> I'll take a look
> 
> On 09/02/17 11:18, Loïc Minier wrote:
>> Hi,
>>
>> Yes, this is typically how you allow a snap to talk to snapd or docker
>> daemon or lxd. You need a new interface to grant access to this socket
>> path. If you'd like some examples or look at existing ones, grep for socket
>> under github.com/snapcore/snapd/interfaces.
>>
>> Cheers,
>> - Loïc
>>
>> On Thu, Feb 9, 2017 at 10:27 AM, Roberto Mier Escandón  <
>> roberto.escandon at canonical.com> wrote:
>>
>>> Hi,
>>>
>>> Is there any way to communicate processes in different snaps using
>>> pipes?. How can it be done in this or other way?


If you want to use a unix domain socket you can easily share the socket
file via the content interface between too snaps. Tony created two
really good example snaps to showcase this:

 * https://github.com/tonyespy/unix-domain-server
 * https://github.com/tonyespy/unix-domain-client

Server side uses the network-bind and client side uses just the network
interface. Also have a look at
https://github.com/snapcore/snapd/wiki/Content-Interface which explains
the details a bit more.

For named pipes I am not sure if both interfaces already allow the
relevant things but its worth a try and otherwise we can easily add the
necessary things.

I hope that helps.

regards,
Simon





More information about the Snapcraft mailing list