mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-01 10:22:08 +00:00
fix: wait for VM power tasks before completing controls
This commit is contained in:
@@ -124,12 +124,19 @@ extract_helper_slug_from_wrapper() {
|
||||
# One update per CT at a time, regardless of whether it came from the
|
||||
# UI or the scheduler. The descriptor remains open for this process.
|
||||
LOCK_DIR="${PROXMENUX_LOCK_DIR:-/run/lock}"
|
||||
exec 9>"${LOCK_DIR}/proxmenux-lxc-update-${VMID}.lock"
|
||||
exec 9>>"${LOCK_DIR}/proxmenux-lxc-update-${VMID}.lock"
|
||||
if ! flock -n 9; then
|
||||
echo "ERROR: another ProxMenux update is already running for CT $VMID." >&2
|
||||
exit 7
|
||||
fi
|
||||
|
||||
if [[ -s "${LOCK_DIR}/proxmenux-lxc-update-${VMID}.lock" ]]; then
|
||||
if ! python3 -c 'import sys; sys.path.insert(0, "/usr/local/share/proxmenux/monitor-app/usr/bin"); import lxc_check_job; lxc_check_job.check_control_task(int(sys.argv[1]))' "$VMID"; then
|
||||
echo "ERROR: container control completion is not confirmed; nothing was changed." >&2
|
||||
exit 7
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${REQUIRE_CHECKED_OS:-0}" == "1" ]]; then
|
||||
if ! python3 -c 'import sys; sys.path.insert(0, "/usr/local/share/proxmenux/monitor-app/usr/bin"); import lxc_check_job; lxc_check_job.checked_os(int(sys.argv[1]))' "$VMID"; then
|
||||
echo "ERROR: a fresh successful positive OS check is required; nothing was installed." >&2
|
||||
|
||||
Reference in New Issue
Block a user