Edited agent to store pid in data dir as well as config