There's something weird about /tmp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Image |
Fix Released
|
High
|
Barry Warsaw | ||
snapd |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I'm noticing a problem with the ubuntu-image snap which needs more investigation. I don't have time for that right now, so filing this bug for later.
If you install the ubuntu-image snap and run
$ ubuntu-image -o /tmp/ui.img -c edge -d pc-amd64-
everything completes successfully, but there will be no /tmp/ui.img file. However if you use something like `-o /home/me/ui.img` then the file *will* end up in /home/me. I suspect that snapd is doing Something Funny with /tmp even though u-i is --devmode. So the /tmp you think you're using at the command line is not the /tmp that the snap sees.
Further, if you drop into pdb right at builder.py's finish() method, you can see that the workdir is /tmp/blah but that doesn't exist outside the snap, so again, I suspect it's a bind mounted directory or some such.
If we can't change this behavior in the snap, we'll need a way to detect it and warn the user.
Changed in ubuntu-image: | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Barry Warsaw (barry) |
Changed in ubuntu-image: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-image: | |
status: | Fix Committed → Fix Released |
This is expected behavior of a snap. The 'home' interface gives the snap visibility on the /home heirarchy as a bind mount; it does not give it access to the /tmp directory of the host system. So the output path is interpreted relative to the snap's container mountpoint only.
The fix for this requires the planned 'classic' mode, which is not yet implemented in snapd.