The challenge is that if "things go south", it is convenient to have a known place to find the process id, and the file is the way many processes use this.  Why don't you ask Diego if using a file is considered "best-practice".  If he says no, then placing the process id into a variable instead of a file is fine with me.  After all, we can always use `ps -ef | grep foo` to find the process if we need to.