We have a SSIS package that we need to prevent from being run more than once at any given time. The package can be executed sequentially, but cannot be executed in parallel. It doesn't matter how the package is called, if an instance of the package is already executing the next time execution is triggered it needs to either, wait (queue up the execution) or return an error that execution is already in progress.
We need some way of enforcing this.
The package can be called from multiple sources:
Triggered from a web application
Called directly from SQL Server