Add flock-based locking to prevent concurrent service operations
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 27s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m1s

This commit is contained in:
j
2026-03-29 16:22:00 +13:00
parent dafc0529f0
commit 10c043878f
3 changed files with 19 additions and 0 deletions

View File

@@ -77,6 +77,9 @@ export TEMPLATE_PATH="${DROPSHELL_DIR}/services/${SERVICE}/template"
[[ -f "${DROPSHELL_DIR}/server_info.env" ]] || _die "Missing ${DROPSHELL_DIR}/server_info.env"
[[ -d "${CONFIG_PATH}" ]] || _die "Service '${SERVICE}' does not exist on server (missing ${CONFIG_PATH})"
# -- Acquire exclusive lock (released automatically on exit) --
_lock_service "${DROPSHELL_DIR}/services/${SERVICE}"
# -- Load template info (template defaults, loaded first) --
export TEMPLATE_INFO_ENV="${TEMPLATE_PATH}/template_info.env"
if [[ ! -f "${TEMPLATE_INFO_ENV}" ]]; then