Skip to content

Commit b1765d2

Browse files
fix: extract-image regression (#791)
Concurrent node/add-module actions fail on flock acquiring the lock file. The lock file is created in a unique path by node/add-module, preventing the execution of multiple modules installation at the same time, which normally happens in cluster/create-cluster and cluster/add-node actions. Refs NethServer/dev#7058 This commit changes extract-image behavior. The lock file is created under ./ (the working directory) instead of AGENT_INSTALL_DIR/.
1 parent fea1a2f commit b1765d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/imageroot/usr/local/agent/bin/extract-image

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ image=${1:?missing image URL argument}
2525
set -e
2626

2727
# Prevent concurrent execution of this script with a lock file opened with
28-
# an arbitrary high FD number, like 201. The lock is released when the
29-
# script completes:
30-
exec 201>"${AGENT_STATE_DIR:?}"/.extract-image.lock
28+
# an arbitrary high FD number, like 201. The lock is created in the
29+
# working directory, and is released when the script completes:
30+
exec 201>.extract-image.lock
3131
flock --verbose -n 201
3232

3333
lst_file=".imageroot.lst"

0 commit comments

Comments
 (0)