I want to create a script that runs two programs. That part's simple, but there's a catch: I want to kill the second one if the first one exits. How can I do that?
Edit
I tried killing the program by it's PID after the other one exits, but the program is hamster-time-tracker
, which is a Python application that exits immediately, apparently spawning another process. How can I get around this? Is there some way to get the other PID spawned?
Edit 2
Figured it out. I had to run python /usr/bin/hamster-time-tracker
instead of hamster-time-tracker
, and it stayed running.