<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
<!--
@font-face
{font-family:Wingdings}
@font-face
{font-family:Wingdings}
@font-face
{font-family:Calibri}
@font-face
{font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif"}
span.EmailStyle17
{font-family:"Calibri","sans-serif";
color:#1F497D}
.MsoChpDefault
{font-family:"Calibri","sans-serif"}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
{}
ol
{margin-bottom:0in}
ul
{margin-bottom:0in}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Re:</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="font-family:Wingdings"><span style="">Ø<span style="font:7.0pt "Times New Roman"">
</span></span></span>However perhaps the design issue you're seeing is not with snaps but rather with debs: alternatives should be declarative rather than imperative – each .deb would document the alternatives it'd like to see updated on install/remove/upgrade.
If we had that piece of data, we could process it when unpacking a .deb without running the postinst as root. But because right now this information is buried inside a shell script which could be of any form and expects to be run as root, we can't use it without
resorting to solutions involving chroots.</p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">While I agree that maybe “debs” should have additional declarative functionality like this, that currently isn’t the case. In my view SNAPs should be designed
to live in the world that IS not in the world we’d like it to be. To be honest I’m surprised that SNAPs don’t make more use of “chroot” like you elude to. I suspect that running the postinst step inside a “chroot” would allow a lot of things to be done in
a secure manner.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Not to take this thread off in a different direction but the major issue we’re having in moving a whole subsystem into a SNAP (one that we didn’t write but
that we are SNAPifying – it happens to be OpenSwitch) is tracking down and finding all the references the absolute root file system names and then adding the appropriate $SNAP_xxx prefix in front of each of them by CHANGING (yuck) the code. I wish that SNAPs
could have made use of chroot and maybe found a neat way to layer the chroot inside the SNAP and the Unbuntu core on top of particular real root directories for R/O access (if the file wasn’t present in the chroot directory). I’m showing my age here but I
wish there was a way you could use chroot and the concept that is used in that ancient (but I understand still being sold) OpenVMS O/S that allowed you to define “concealed logical names” mapped to an equivalence LIST that essentially enabled one name to reference
a list of real directories in way where the user is totally unaware that the “logical” directory is really an amalgamation of contributions from multiple different places. Anyway I digress, I guess for now I’ll hack a custom solution for the “deb” I’m having
issues with due to the postinst not being able to be run.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> loic.minier@canonical.com [mailto:loic.minier@canonical.com]
<b>On Behalf Of </b>Loïc Minier<br>
<b>Sent:</b> Tuesday, August 09, 2016 8:18 AM<br>
<b>To:</b> David Garrod<br>
<b>Cc:</b> Didier Roche; snapcraft@lists.ubuntu.com<br>
<b>Subject:</b> Re: How do I get a postinst stage properly executed - traceroute will not install correctly</span></p>
<p class="MsoNormal"> </p>
<div>
<div>
<div>
<p class="MsoNormal">Hi,</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">On Mon, Aug 8, 2016 at 12:01 PM, David Garrod <<a href="mailto:dgarrod@extremenetworks.com" target="_blank">dgarrod@extremenetworks.com</a>> wrote:</p>
<div>
<div>
<p class="MsoNormal" style=""><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">While I’m sure I could hack this particular case and add a link in the startup of my snap I don’t see this as a general solution. What if a later
version of the package changes the name of the file or something. Any true solution has to be based in what is in the postinst for the version of the package being installed. This seems like a general issue to me. In order to make the whole snap concept viable
surely you have to be able to take packages unchanged and have your SNAP depend on them just as packages in the non-SNAP world depend on each other. I’d really like to see a mechanism whereby the installation of a SNAP can run the post install configure step
in the context of the installation. Maybe that would involve deferring some of this to the snap start if absolutely necessary but in general this would not be needed. Are there any active plans to address this fundamental design issue?</span></p>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">It's indeed by design; snaps and debs are different. In the .deb world, you can hack the whole system in the postinst, leading to intrusive changes or problems upgrading, interferences between postinst initiated changes etc.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">However perhaps the design issue you're seeing is not with snaps but rather with debs: alternatives should be declarative rather than imperative – each .deb would document the alternatives it'd like to see updated on install/remove/upgrade.
If we had that piece of data, we could process it when unpacking a .deb without running the postinst as root. But because right now this information is buried inside a shell script which could be of any form and expects to be run as root, we can't use it without
resorting to solutions involving chroots.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">- Loïc Minier</p>
</div>
</div>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="2"><br>
DISCLAIMER:<br>
This e-mail and any attachments to it may contain confidential and proprietary material and is solely for the use of the intended recipient. Any review, use, disclosure, distribution or copying of this transmittal is prohibited except by or on behalf of the
intended recipient. If you have received this transmittal in error, please notify the sender and destroy this e-mail and any attachments and all copies, whether electronic or printed.<br>
</font>
</body>
</html>