in reply to Locking out a CGI script whilst it runs
Make sure if have a "die" handler that will remove the lock file if your script dies unexpectedly.