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

Didier Roche didrocks at ubuntu.com
Fri Jul 29 06:15:22 UTC 2016


Le 28/07/2016 à 18:32, David Garrod a écrit :
> Thanks for your reply.
> 
>  
> 
> Re:
> 
>  
> 
> Ø  Looking at the postinst, it doesn't seem this is actually that you
> need to execute any postinst in this specific case. The
> update-alternative calls here are just to make available a default
> "traceroute" binary pointing to your "usr/bin/traceroute.db" (same for
> manual page). You can expose it directly through apps to get the same
> result:
> apps:
>   traceroute:
>     command: $SNAP/usr/bin/traceroute.db
> 
> If the issue is that other commands from this package are using
> "traceroute" internally, you can ship a symlink yourself that you ensure
> are in your $PATH snap.
> 
> 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.
> 
>  
> 
> If I install the package outside the SNAP using ‘dpkg install’ or
> ‘apt-get install’ it properly installs on a UBUNTU system. What I’m
> looking for is the mechanism to get the package installed inside the SNAP.
> 
>  
> 
> The current behavior just seems wrong to me. Are there any plans to fix it?

I'll let the snapcraft team answering this, but I don't think this is
even doable.

Postinst scripts executes as root and do system level actions. This goes
against what we are trying to do with snapd, as this void the
transactional update/rollback mechanism (what does those scripts do?)
and security garantees as those scripts have access to the whole system,
while running as root.

Cheers,
Didier




More information about the Snapcraft mailing list