Generate PID name based on script name

Fixes #533