apport integration into postinst scripts

Matt Zimmerman mdz at
Wed Nov 25 11:04:58 GMT 2009

On Wed, Nov 18, 2009 at 04:37:50PM +0100, Reinhard Tartler wrote:
> Matt Zimmerman <mdz at> writes:
> > I suggest looking at the existing scripts in /usr/share/apport which create
> > problem reports in response to various error events.
> Ok, it seems that currently the best way would be to change
> /usr/share/apport/general-hooks/, since apport (currently) does
> not seem to provide better integration for postinst failiures. That file
> contains special handling for grub, grub2, initramfs, and kernel
> packages, so I guess adding emacsen to that list is the way to go.

The logic for maintainer script failures in tries to guess the
right package where apt gets it wrong, e.g. when the kernel postinst fails
because of grub2.  If that's analogous to the issue with emacsen (e.g. an
elisp package causing some other package's postinst to fail), then you could
do the same thing.  It's a bit of a hack, though, as it parses through the
log to try to figure out what happened.

If there is some common hook already for emacs packages, you could probably
do better.  For example, see /usr/share/apport/gcc_ice_hook which gets
called when GCC detects an internal compiler error (instead of using the
default segfault handler).  If you could arrange for a script like this to
be run whenever there is a failure, you could use that instead of APT's
package_hook script.

Does that make sense?

 - mdz

More information about the ubuntu-devel mailing list