-
Notifications
You must be signed in to change notification settings - Fork 3
Add a poorman kill command. #4
Description
One of the key motivations of poorman: Ensure managed processes actually die on exit.
Occasionally processes need a kill -9. It's a frustrating experience for developers to have to chase down rogue processes, especially during development and integration testing when things may not be stable. However, poorman itself should exit as soon as possible and there's no way to know whether a process is cleaning up after itself or is stuck indefinitely.
After the 1.0 release (#3), poorman can deviate from foreman by adding a poorman kill [KILL ARGS] command which calls the kill command with the kill args. Arguments are optional after poorman kill,
Once implemented:
- Document the kill subcommand in the README.
- Add this to the README on differences between poorman and foreman.
- Add a note to use
poorman kill; true, as poorman gives feedback in its status code. - Add a note to the usage section in the README to ignore
.poorman-kill, which is the script that poorman will write to implement this feature.
For usage, poorman kill could either log IDs of processes being killed or run in set -x mode, and write to stderr when there are no processes to kill and exit 1. The poorman kill command should clean up the .poorman-kill file upon exit.
poorman could set itself up in the "not totally naive" way by querying for which processes are still running, and only set itself up to kill those on the next invocation. The goal here would be to "do nothing" for commands which behave well and exit immediately.
This approach will give full control to the developer, without having an opinion about how long processes should take to exit, while seeking an exit from poorman's main process as soon as possible (as kill 0 is the most complete approach to killing the process group), and assumes that not all processes are broken.