Create a systemtap script capable of trapping any signals sent from userspace, examples here:
In addition to trapping signals, the systemtap script must be able to detect specific signals coming from specific users/processes and change their effective uid to the owner of the target process (or root).
This will be used to fix a known issue with Apache/mod_fcgi/suexec where the idle process scanner cannot prune suexec'd fcgi workers. In this case, idle workers running as the customer's user do not receive the signal to exit from the parent httpd process which runs as the apache user.
The systemtap script must be configurable:
- so it only traps signals from specific users (apache in this case)
- so it only traps specific signal(s) (eg SIGTERM, SIGKILL)
- so it can either change signal euid to uid of target process or root(0)
There should also be a debug option, configurable through writing to /proc:
- echo 0 > /proc/systemtap/sigbooster/debug = turn off debugging
- echo 1 > /proc/systemtap/sigbooster/debug = log only trapped signals
- echo 2 > /proc/systemtap/sigbooster/debug = log all signals
- logfile can be read from /proc/systemtap/sigbooster/log
Finished code must be checked in to our github repository, and must include simple documentation in markdown format, installer, init scripts and GPLv2/3 LICENSE file.
Please see an example project here for more details: https://github.com/paulmaunders/usertop