[sos-devel] sosreport and snap (sandboxing) issue
Pierre Equoy
pierre.equoy at canonical.com
Fri Oct 19 07:19:50 UTC 2018
Hello!
I've been trying to package sosreport as a snap [1] along a small tool I've
developed to submit issues in a bugtracker.
I've been facing an issue with several plugins (e.g. the pci or usb ones)
which generate empty log files. After some investigation [2], I discovered
that the culprit might be sosreport itself given that it hardcodes paths in
the $PATH environment variable [3].
For instance, I found that replacing
PATH = "/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" \
+ ":/usr/local/sbin:/usr/local/bin"
with
PATH =
"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$SNAP/usr/games:$SNAP/usr/local/games"
\
+ ":$SNAP/usr/local/sbin:$SNAP/usr/local/bin"
in policies/debian.py [3] helps producing a better-looking report (I mean
lspci and lsusb logs are available and contain relevant information).
Given how snaps are sandboxed, there is currently no way of using sosreport
in a snap as it is. Apart from manually patching the policies/debian.py
file before packaging sosreport in my snap, is there a better way to deal
with this issue?
Thanks in advance for your help!
[1] https://snapcraft.io/
[2]
https://forum.snapcraft.io/t/report-generated-from-sosreport-within-my-snap-is-incomplete/6453
[3] https://github.com/sosreport/sos/blob/master/sos/policies/debian.py#L16
--
Pierre Equoy
QA Engineer | Canonical Ltd.
www.canonical.com | www.ubuntu.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/sos-devel/attachments/20181019/0073e78f/attachment.htm>
More information about the sos-devel
mailing list