XDG_RUNTIME_DIR, etc

Ted Gould ted at ubuntu.com
Fri Aug 14 14:21:59 UTC 2015


On Fri, 2015-08-14 at 15:03 +0100, John Lenton wrote:

> we're currently not exposing a runtime dir to snaps, and that together
> with our private random tmpdirs mean we don't have a good story for a
> snap shipping a service that creates a socket and a binary that wants
> to communicate with that service over that socket; people are using
> the data dir for now, but it's not ideal.
> 
> I think we should:
> 
> * remove the random component from the tmpdir (this has security
> implications around the predictable tmpdir creation, but I think it's
> doable?)
> 
> * set up a private per-package system runtime dir mount, similarly to
> what we do for /tmp (ie make it a sub of /run/
> 
> * set up a private per-package user runtime dir mount, under
> /run/user/$UID/package.etc
> 
> does this all make sense, or am i overthinking it?



I think that does make sense, but we should perhaps approach it from the
perspective of application goals. It seems to me there are basically
four types of data an application would want:


      * User data. Stuff created by the user that is important to save
        for him/her.
      * Configuration data. Good to keep around, but likely if it got
        deleted it would be more about inconvenience rather than "data
        loss."
      * Caches. Data that we use to make the application more enjoyable
        to use, but if lost can be recreated with increased cpu/network
        usage.
      * Per-run data. Sockets and other filesystem objects that should
        be recreated each time the system is restarted.


So it seems like we're mapping user and configuration data to the
SNAP_APP_DATA_PATH. Then we're using the TMPDIR for caches. I think that
it makes sense to add a RUNTIME dir for the last case.

Ted

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snappy-devel/attachments/20150814/bea4bfcd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/snappy-devel/attachments/20150814/bea4bfcd/attachment.pgp>


More information about the snappy-devel mailing list