Skip to main content

Questions tagged [flock]

5 votes
1 answer
373 views

Common method for preventing concurrent runs for a given script is utilizing flock as: LOCK=/var/lock/my-lock exec 9>>"$LOCK" if ! flock --exclusive --nonblock 9; then echo "...
basher's user avatar
  • 71
2 votes
1 answer
108 views

It seems that Linux has tightened up security in /tmp in later kernels than 3.x and if /tmp has the sticky bit set another user may not modify a 0777 file. Are there any work arounds for sharing a ...
rrauenza's user avatar
  • 852
2 votes
1 answer
316 views

I was confused for a very long time with the meaning of the -n flag for flock(1). Basically there are many guides for this tool, and often what we see is some command like flock -n 100. Here, fd ...
Steven Lu's user avatar
  • 2,432
0 votes
0 answers
231 views

If given a lock on a script using flock(), is it possible to make a force run/unlock based on some argument passed to the script?
derwian36's user avatar
0 votes
2 answers
130 views

This is unusual problem and probably it is the consequence of bad design. If somebody can suggest anything better, I'd happy to hear. But right now I want to solve it "as is". There is a ...
Nikita Kipriyanov's user avatar
-2 votes
1 answer
350 views

WaitForMultipleObjects is one of several Windows kernel functions that can suspend and synchronize a calling thread with other threads until resources or etc are available, similar to flock in Linux, ...
Codemeister's user avatar
0 votes
2 answers
207 views

I have a command which I run via eval as shown below. #! /bin/sh readonly scr="MYENV=1 sh /tmp/scr.sh" eval ${scr} -a 1 -b 2 Now I want to run the scr script with lockf utility, so I made ...
Rahul Bharadwaj's user avatar
-2 votes
2 answers
2k views

EDIT: I learned how to use flock for exclusive lock and how to not mess with it: https://superuser.com/questions/1619940/flock-is-randomly-failing-on-desktop-pc-but-not-on-notebook-could-be-defectiv/. ...
Aquarius Power's user avatar

15 30 50 per page