pid & permission check fro service script