Use directory from config for checking pid rather than a static one.