in reply to Check for another running instance of the same program
You can safely automate the deletion of the semaphore file by writing the PID to it, and having later programs check if the PID exists as a running process; if not it can delete the file and proceed.
Consider your requirements carefully; for example, does it apply to one system, or all systems that can access a particular NFS mount, or all systems on a built-in list with IP connectivity, or what exactly. These lead to very different solutions. Do you want to consider expanding it to "no more than n" copies running at once, or is the simple one at a time good?