My second snap ;-)

Robert Park robert.park at canonical.com
Mon Oct 3 18:51:31 UTC 2016


On Sun, Oct 2, 2016 at 11:20 PM, Didier Roche <didrocks at ubuntu.com> wrote:
> Le 02/10/2016 à 20:48, Robert Park a écrit :
>> Is there a plug to just read /etc? or a sensible way to set all those
>> env vars to /dev/null or something?
> Hey Robert,
>
> There is no plug to read from /etc on purpose. The goal is your snap to
> be relocatable and not relying on anything system-wide, so that it can
> run in different context. That's why you need to find a way to embedded
> this file and looking for local assets.

But aren't snaps running inside chroots? Why does "/etc" refer to the
system /etc instead of the /etc inside the snap chroot? Am I
understanding correctly that snaps bindmount the system /etc into the
snap chroot and then don't provide any permission to read anything in
there?

I think it would be nice if "/etc" was just inside my snap chroot and
my snap thus had total ownership of the entire dir.


> If you want to change some env vars, you can create a shell wrapper that
> you point your snap into. The shell will then executed your real binary,
> once it has settled your environment properly.

Yeah this seems like a more reasonable approach, thanks.


-- 
robru




More information about the Snapcraft mailing list