ts
ts copied to clipboard
Kill jobs on teardown
Probably need to think about this more, but if you start background jobs then they will hang without something like this:
jobs -p | xargs kill
Bonus points to kill politely, then kill -9 if they don't exit in a reasonable time.
This may be extremely non-trivial. One of the problems I've run into is that you can kill but then it's hard to know if you should kill -9 later. See here.