Writing the process id to file such that we can use it to kill the non
interactive standalone process