Create parent dir before writing .pid file