Simple example of how to properly launch background jobs and then gracefully terminate them.
- We could trap only the
EXIT
signal, but then after killing workers we get an unwanted "Terminated" message. - In worker scripts, we must call
exit
when cleaning, to break out of the infinite loop - After killing a worker, we still have to wait for them to gracefully terminate.