jjoos/foreman — pull request #1 by jjoos (2013-11-14 15:34:02+00:00)
Title: A better fix for #357.

This is a better fix for several reasons:

- It's more portable; the arguments/options to 'ps' vary widely across
platforms.
- Killing children by forking yet more children (i.e., via backtick) is
problematic when you're trying to kill processes because of resource
starvation.
- Processes should not signal processes other than their own children,
especially in a generic task-runner like Foreman. If the signal
should propagate, then the sub-process should propagate signals to its
children itself. There's no way to know what cleanup or preparation
is necessary for a clean shutdown (e.g., SIGINT/SIGTERM), and
in what order grandchild processes should be shut down to properly
release locks, close files, etc.
- foreman-runner doesn't (shouldn't?) create grandchild processes; the
last thing it does is `exec` the program it's launching, which
will replace the program of the *current* process with the one
being started up.