<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03/02/17 12:41, Loïc Minier wrote:<br>
</div>
<blockquote
cite="mid:CA+gR0s99G16gfCebj67o6JDq+w7PBv-j8yt9F2kN1JVtzt5owA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_quote">
<div>In classic mode, you see libraries from your classic
Ubuntu system including X11; in devmode/confined mode, you
only see system libraries from the core snap which doesn't
contain X11.</div>
</div>
</div>
</blockquote>
<br>
One more point. If you try this command you will be running a shell
"inside the snap", in other words, you will be experiencing the
filesystem exactly as your snap sees it.<br>
<br>
$ snap run --shell <snap><br>
<br>
Now you are living inside the container that is setup just for that
snap. It's using the same sorts of mechanisms as LXD and Docker to
keep processes apart, but it is also setup in such a way that files
can be shared across snaps. You can see the environment variables
that snapd has setup so snap processes can find out where they can
write data etc:<br>
<br>
$ set | grep SNAP<br>
SNAP=/snap/etcd/x5<br>
SNAP_ARCH=amd64<br>
SNAP_COMMON=/var/snap/etcd/common<br>
SNAP_DATA=/var/snap/etcd/x5<br>
SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:<br>
SNAP_NAME=etcd<br>
SNAP_REEXEC=<br>
SNAP_REVISION=x5<br>
SNAP_USER_COMMON=/home/mark/snap/etcd/common<br>
SNAP_USER_DATA=/home/mark/snap/etcd/x5<br>
SNAP_VERSION=2.3.7<br>
<br>
And if you start using 'ls' to poke around the filesystem, you
quickly see that you are in your own special world:<br>
<br>
$ ls /<br>
ls: cannot open directory '/': Permission denied<br>
<br>
$ sudo ls /<br>
bash: /usr/bin/sudo: Permission denied<br>
<br>
$ ls -l /lib/<br>
total 74<br>
drwxr-xr-x 2 root root 52 Jan 13 20:41 apparmor<br>
drwxr-xr-x 2 root root 57 Jan 13 20:41 bridge-utils<br>
drwxr-xr-x 2 root root 40 Jan 13 20:41 cgmanager<br>
drwxr-xr-x 3 root root 89 Jan 13 20:41 crda<br>
drwxr-xr-x 2 root root 3 Jan 13 20:40 firmware<br>
drwxr-xr-x 2 root root 1032 Jan 13 20:41 i386-linux-gnu<br>
drwxr-xr-x 2 root root 59 Jan 13 20:41 ifupdown<br>
drwxr-xr-x 2 root root 51 Jan 13 20:41 init<br>
-rwxr-xr-x 1 root root 70952 Sep 22 18:34
klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so<br>
lrwxrwxrwx 1 root root 25 Nov 16 22:51 ld-linux.so.2 ->
i386-linux-gnu/ld-2.23.so<br>
drwxr-xr-x 3 root root 61 Jan 13 20:41 lsb<br>
drwxr-xr-x 2 root root 35 Jan 13 20:41 modprobe.d<br>
drwxr-xr-x 6 root root 4096 Jan 26 10:15 modules<br>
drwxr-xr-x 2 root root 31 Jan 13 20:41 netplan<br>
drwxr-xr-x 2 root root 35 Jan 13 20:41 resolvconf<br>
drwxr-xr-x 8 root root 1057 Jan 13 20:41 systemd<br>
drwxr-xr-x 15 root root 132 Jan 13 20:41 terminfo<br>
drwxr-xr-x 4 root root 298 Jan 13 20:41 udev<br>
drwxr-xr-x 3 root root 4281 Jan 13 20:41 x86_64-linux-gnu<br>
drwxr-xr-x 2 root root 2531 Jan 13 20:41 xtables<br>
<br>
So you see, this is a super-minimal "core" with just a few
libraries.<br>
<br>
You can find your snap at $SNAP:<br>
<br>
$ echo $SNAP<br>
/snap/foo/7<br>
$ ls -lR $SNAP<br>
/snap/foo/x5:<br>
... <your snap tree here><br>
<br>
Hope that's a useful introduction. It's a lot of fun once you
realise that you have TOTAL control over your snap, but everything
else is very structured for you.<br>
<br>
Mark<br>
</body>
</html>