snap fails because XDG_RUNTIME_DIR is set to /run/user/1000
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snappy |
Fix Released
|
High
|
Jamie Strandboge | ||
snap-confine |
Fix Released
|
High
|
Jamie Strandboge |
Bug Description
I'm trying to snap the keybase.io go client. I can build it properly, but when I try to run the commands it fails like this:
$ keybase status
▶ WARNING Running in devel mode
▶ ERROR dial unix /run/user/
Looking at the source code, it's trying to write to $XDG_RUNTIME_DIR, which is:
$ echo $XDG_RUNTIME_DIR
/run/user/1000
And the snap doesn't have permission to write to that directory:
Log: apparmor="DENIED" operation="mkdir" profile=
File: /run/user/
Suggestions:
* adjust program to use $SNAP_DATA
* adjust program to use /run/shm/
Searching in the mailing list, there is a suggestion from John from one year ago, to give a runtime dir to every package: https:/
To reproduce:
$ git clone https:/
$ cd keybase
$ git checkout snapcraft
$ sudo apt install snapcraft
$ snapcraft
$ sudo snap install keybase*.snap
$ keybase status
tags: | added: snapd-interface |
Changed in snappy: | |
status: | New → Triaged |
affects: | snappy → snap-confine |
Changed in snap-confine: | |
importance: | Undecided → High |
assignee: | nobody → Zygmunt Krynicki (zyga) |
Changed in snap-confine: | |
assignee: | Zygmunt Krynicki (zyga) → Jamie Strandboge (jdstrand) |
status: | Triaged → In Progress |
Changed in snappy: | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
importance: | Undecided → High |
status: | New → In Progress |
Changed in snap-confine: | |
milestone: | none → 1.0.45 |
status: | In Progress → Fix Committed |
Changed in snap-confine: | |
milestone: | 2.19 → none |
no longer affects: | snapd (Ubuntu) |
We need this for dconf.
See https:/ /specifications .freedesktop. org/basedir- spec/basedir- spec-latest. html for info about the general requirements for the directory.
In particular, for dconf's case:
- a new directory should be created when an app is run, and it should be shared
between instances of that app (to the extent that this makes sense in the snappy world)
- the app should not be able to see the external XDG_RUNTIME_DIR
- the directory that is created (or some part of it) needs to be visible to the outside world DIR/app/ appid/ such that this directory is the
flatpak does this by bindmounting XDG_RUNTIME_
same on the inside and outside.