Update to handle applocker permission based blocking
This commit is contained in:
46
install.sh
46
install.sh
@@ -222,12 +222,48 @@ docker pull "${IMAGE}" || {
|
||||
# -----------------------------
|
||||
# Stop old container
|
||||
# -----------------------------
|
||||
log "Cleaning up existing Tentacle container (if any)..."
|
||||
cleanup_container() {
|
||||
local name="$1"
|
||||
|
||||
if docker inspect "${CONTAINER_NAME}" >/dev/null 2>&1; then
|
||||
docker stop "${CONTAINER_NAME}"
|
||||
docker rm -f "${CONTAINER_NAME}"
|
||||
fi
|
||||
log "Cleaning up existing container: $name"
|
||||
|
||||
# If container doesn't exist, nothing to do
|
||||
if ! docker inspect "$name" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Try graceful stop first
|
||||
docker stop "$name" >/dev/null 2>&1 || true
|
||||
|
||||
# Try force remove
|
||||
docker rm -f "$name" >/dev/null 2>&1 || true
|
||||
|
||||
# Check if it's still there
|
||||
if docker inspect "$name" >/dev/null 2>&1; then
|
||||
warn "Docker could not remove $name, attempting manual kill..."
|
||||
|
||||
# Get PID
|
||||
local pid
|
||||
pid="$(docker inspect -f '{{.State.Pid}}' "$name" 2>/dev/null || echo "")"
|
||||
|
||||
if [[ -n "$pid" && "$pid" != "0" ]]; then
|
||||
warn "Killing stuck container process (PID=$pid)"
|
||||
kill -9 "$pid" >/dev/null 2>&1 || true
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# Final remove attempt
|
||||
docker rm "$name" >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
# Verify
|
||||
if docker inspect "$name" >/dev/null 2>&1; then
|
||||
err "Failed to remove container $name (manual intervention required)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup_container "${CONTAINER_NAME}"
|
||||
|
||||
# -----------------------------
|
||||
# Create dirs
|
||||
|
||||
Reference in New Issue
Block a user