I want to make sure that only one script can be run by any regular user of a system at a time. There can be multiple users logged in and each of them should only be able to run a command after any running commands of other users have finished.
A long time ago on UNIX I was using the
batch command with a proper "one task only" queue definition to serialize scripts execution. It solved lot of lock management problems (it needed only a simple timeout to set in the scripts).
Now on Linux the
batch command performs differently, one task is run at each minute, tasks run in parallel until 1.5 load average is reached.
I made my own lock management shell library to serialize execution but I wonder if there is a standard command for doing that.