PID and lockfiles are definitely the most reliable. When you attempt to run the program, it can check for the lockfile which and if it exists, it can use ps
to see if the process is still running. If it's not, the script can start, updating the PID in the lockfile to its own.