https://unix.stackexchange.com/questions/30370/how-to-get-the-pid-of-the-last-executed-command-in-shell-script
my-app & echo $! >> /tmp/my-app.pid