2
votes
1answer
42 views

Controlling bash script concurrency, flock inheritance

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 ...
5
votes
3answers
457 views

Why do package managers need lock files?

dpkg uses a lock file (/var/lib/dpkg/lock), when in use. Why are these lockfiles needed? Why are multiple instances not possible?
5
votes
1answer
68 views

Is `ln` atomic and reliable on NFS? Could NFS replace GFS in this use case?

I have a cluster with a bunch of servers with a shared disk containing a GFS global file system that all nodes access simultaneously. Each node in the cluster run the same program (a shell script is ...
2
votes
1answer
3k views

How do you make a cross-process locking in Linux (C/C++)?

I need to make sure one process executes only in one instance at a time. On Windows you could use named mutex. But I have no idea what to use on Linux. I think I've seen an approach were app creates ...