Revision 7426
Added by Aaron Marcuse-Kubitza almost 12 years ago
bin/lockfile | ||
---|---|---|
2 | 2 |
# Wraps lockfile/dotlockfile |
3 | 3 |
# Usage: env [interval=...] self lockfile |
4 | 4 |
|
5 |
selfDir="$(dirname -- "$0")" |
|
6 |
|
|
5 | 7 |
: "${interval=5}" # s |
6 | 8 |
|
7 | 9 |
if test "$(uname)" = Darwin; then |
8 | 10 |
while ! shlock -p "$PPID" -f "$1"; do sleep "$interval"; done |
9 | 11 |
else |
10 |
exec dotlockfile -l -r -1 -p "$1" # need exec to inherit PPID
|
|
12 |
exec "$selfDir/dotlockfile" -l -r -1 -p "$1" # need exec to inherit PPID
|
|
11 | 13 |
fi |
Also available in: Unified diff
lockfile: Linux: Use bin/dotlockfile instead of the system's dotlockfile, because the system's dotlockfile is SETGID mail, which prevents it from creating lockfiles in a directory owned by the bien user and group when being run by the login user