One minor problem with doing it that way...
If I double click on the submit button, it works. The second process is
terminated immediately. However, the original process goes into defunct status
and exits after it is done processing the databases. It never makes it to the
exit routine that removes the .lock file. So the file is stuck and the process
will not run again until it is removed. Any suggestions?
Any ideas on how I can kill the previous process if I double click on the submit
button? That would work for me... I am not sure how to check for a second
process and capture it's pid#. Once I obtain the pid#, how do I kill that
process in perl?
Thanks in advance.
Bug Hunter wrote:
> If you create a lock file (perhaps in /var/lock), with the program's
> file name, ending in .lck, you can check for that at the beginning of the
> perl script and exit immediately if that file exists. At the end of the
> perl script delete the file.
>
> You can still have a race condition if two people click on the button at
> the same instance, but it is highly unlikely, and can be disregarded for
> your purposes.
>
> bug