Isn't this a config param?  Somehow, the string used for the creation of the pid file should be reused here.