I have a bash deployment script that handles deploying updated code to a Tomcat instance on CentOS, however, both Chef and RunDeck may invoke the script, and since Chef runs periodically there is a chance of a collision.
How do I prevent the deployment script from running twice concurrently?
The standard answer looks to be to wrap the deploy logic in a
However, since the deploy restarts tomcat that isn't working -- the new java process inherits the lock and prevents any further deploy scripts from executing.
Is there another way to prevent concurrent execution or a way to prevent