add RUNNING_PID logic, borrowed from playframework
use user.dir like play to run script