Hi,
I have a process which can run one instance at a time. Currently we have multiple scripts trying to kickoff this process. I wanted to implement the semaphore mechanism to achieve this.
I was going through few examples. The below code seems to be reasonable solution.
But I am concerned about limitations, eg. we do not have much control on the filename (in the above case, "important")
Especially our team who maintains the application in Production are not experts.
Which technique (command) would you recommend (least errors and less experience to maintain)
I have a process which can run one instance at a time. Currently we have multiple scripts trying to kickoff this process. I wanted to implement the semaphore mechanism to achieve this.
I was going through few examples. The below code seems to be reasonable solution.
Code:
...
lockfile important.lock
...
access_"important"_to_your_hearts_content
...
rm -f important.lock
Especially our team who maintains the application in Production are not experts.
Which technique (command) would you recommend (least errors and less experience to maintain)