How do I get a postinst stage properly executed - traceroute will not install correctly

Oliver Grawert ogra at ubuntu.com
Mon Aug 8 16:10:56 UTC 2016


hi,
On Di, 2016-08-02 at 12:35 +0200, Loïc Minier wrote:
> Hi David,
> 
> > Yes I know I can do some special messing around to try and fix up
> > the installation but I don’t think that is a good idea. How can I
> > get the package to install fully and correctly inside the SNAP,
> > i.e. properly execute the “postinst” commands.
> > 
> 
> Taking a step back, Snapcraft is a tool to help you assemble snaps
> from various pieces. The stage-package feature is meant to easily
> consume package contents, but it's not a perfect installation of a
> .deb honoring posting etc. At the moment, it just unpacks the .deb
> (dpkg -x) as if it was a tarball.
> 
> Capturing the installation of any possible .deb and its postinst
> would be quite complex:
> - we'd have to run these postinsts with root permissions during the
> build (however we do sudo apt install on the build-packages, so
> that's technically possible albeit intrusive)
> - we'd need a chroot and a way to record the changes done to this
> chroot (as to extract the new files)
> - we'd need to decide what to do with modified/updated files
> 
there is one bit missing in your list:

- we'd need to make sure your host doesnt get random system users or
home dirs created for a stage package (which does not actually get
installed on the build host but in the stage area) 

imho that is the most ugly bit that prevents us from running postinsts
... 

nontheless, even if you'd run them in a chroot, your paths would be
broken in the resulting snap (this is true for a lot of things.
starting with links over adduser calls up to update-alternatives ...
not using the postinst scripts but properly setting up your start
scripts inside the snap package to provide such a setup is still the
sanest way here IMHO...

ciao
	oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160808/33dce2bf/attachment.sig>


More information about the Snapcraft mailing list