Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 137888

Summary: trap hook
Product: Portage Development Reporter: Luigi 'Comio' Mantellini <luigi.mantellini+gentoo>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED OBSOLETE    
Severity: enhancement CC: alex_y_xu
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Luigi 'Comio' Mantellini 2006-06-24 15:35:06 UTC
I'm making some bashrc scripts to enhance emerge. I'm interested to catch signals (SIGQUIT, SIGINT, SIGTTRAP) in my code without to generate conflicts with the emerging process.

I ask you to introduce some hooks to intercept the signals (for example, modifying the abort_* function in ebuild.sh to call an user-defined handler-function).

Thanks
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2007-06-23 19:49:03 UTC
Do we want to support this?
Comment 2 Zac Medico gentoo-dev 2007-06-30 10:55:16 UTC
I'm curious about what some of the use cases will be for the proposed hooks.  Most of our ebuild.sh traps are pretty useless and I'd like to remove them (or replace them with hooks if that's really useful).  The only trap that currently seems to do anything useful is the SIGTERM trap which is used to implement support for die in a subshell.
Comment 3 Alex Xu (Hello71) 2015-06-10 14:11:28 UTC
checking my portage-2.2.18 ebuild.sh, there appears to only be a SIGTERM trap.

SIGTERM needs to be trapped for die to work, and the only standard utility that generates it is "kill" which can be easily modified to generate another signal.