log-observe interface is broken in latest snap-confine
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snap-confine |
Fix Released
|
Critical
|
Zygmunt Krynicki | ||
snap-confine (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
The snapd interface "log-observe" is broken due to how we handle bind mounts.
This bug is fixed by adding /var/log to a list of directories that are bind mounted and thus visible to snaps in their execution environment.
For more information about the execution environment, please see this article http://
[Test Case]
The test case can be found here:
https:/
The test case is ran automatically for each pull request and for each final release. It can be reproduced manually by executing the shell commands listed in the prepare/
The commands there assume that snapd and snap-confine are installed.
No other additional setup is necessary.
[Regression Potential]
* Regression potential is minimal as the fix simply adds another directory to a list of directories that needs to be bind mounted.
* The fix was tested on Ubuntu via spread and on several other distributions successfully.
[Other Info]
* This bug is a part of a major SRU that brings snap-confine in Ubuntu 16.04 in line with the current upstream release 1.0.41.
* This bug was included in an earlier SRU and is now fixed in Ubuntu. I am updating the template here to ensure that the process is fully documented from 1.0.38 all the way up to the current upstream release 1.0.41.
* snap-confine is technically an integral part of snapd which has an SRU exception and is allowed to introduce new features and take advantage of accelerated procedure. For more information see https:/
== # Pre-SRU bug description follows # ==
The log-observe interface is broken due to how we handle bind mounts now. This can be seen with 'snappy-debug':
$ sudo snap install snappy-debug
$ sudo snap connect snappy-
$ sudo /snap/bin/
kernel.
Traceback (most recent call last):
File "/snap/
sys.
File "/snap/
from_
File "/snap/
self.
File "/snap/
log = open_file_
File "/snap/
orig = codecs.open(path, 'r', "UTF-8", errors="replace")
File "/usr/lib/
file = builtins.
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/syslog'
This is because /var/log/syslog is not available at runtime due to the bind mounts. This can be shown by installing hello-world, adjusting /var/lib/
$ hello-world.sh
...
bash-4.3$ ls /var/log/
alternatives.log btmp dpkg.log fsck watchdog
bootstrap.log dmesg faillog lastlog wtmp
This may also be a problem with other interfaces, I haven't checked extensively, though it seems that /var/lib/extrausers (from the nameservice abstraction) won't work right, and (at least) ppp (/var/log/ppp) and timezone-control (/usr/share/
WORKAROUND for snappy-debug: launch outside of the launcher:
$ sudo SNAP=/snap/
tags: | added: snapd-interface |
description: | updated |
Changed in snap-confine: | |
status: | In Progress → Fix Released |
Changed in snap-confine (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in snap-confine (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
Ah, I'm sorry, I will fix this ASAP and issue a new release.