aidevops 3.13.70 → 3.13.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/aidevops.sh +1 -1
- package/package.json +1 -1
- package/setup.sh +60 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.13.
|
|
1
|
+
3.13.72
|
package/aidevops.sh
CHANGED
package/package.json
CHANGED
package/setup.sh
CHANGED
|
@@ -12,7 +12,7 @@ shopt -s inherit_errexit 2>/dev/null || true
|
|
|
12
12
|
# AI Assistant Server Access Framework Setup Script
|
|
13
13
|
# Helps developers set up the framework for their infrastructure
|
|
14
14
|
#
|
|
15
|
-
# Version: 3.13.
|
|
15
|
+
# Version: 3.13.72
|
|
16
16
|
#
|
|
17
17
|
# Quick Install:
|
|
18
18
|
# npm install -g aidevops && aidevops update (recommended)
|
|
@@ -1178,6 +1178,55 @@ _setup_lock_dir_age_seconds() {
|
|
|
1178
1178
|
return 0
|
|
1179
1179
|
}
|
|
1180
1180
|
|
|
1181
|
+
_setup_lock_started_age_seconds() {
|
|
1182
|
+
local lock_dir="$1"
|
|
1183
|
+
local started_str=""
|
|
1184
|
+
local started_epoch=""
|
|
1185
|
+
local now_epoch=""
|
|
1186
|
+
if [[ -r "$lock_dir/started_at" ]]; then
|
|
1187
|
+
started_str=$(tr -d '[:space:]' <"$lock_dir/started_at" 2>/dev/null || true)
|
|
1188
|
+
started_epoch=$(date -d "$started_str" +%s 2>/dev/null || \
|
|
1189
|
+
date -jf '%Y-%m-%dT%H:%M:%SZ' "$started_str" +%s 2>/dev/null || true)
|
|
1190
|
+
now_epoch=$(date +%s 2>/dev/null || true)
|
|
1191
|
+
if [[ "$started_epoch" =~ ^[0-9]+$ && "$now_epoch" =~ ^[0-9]+$ && "$now_epoch" -ge "$started_epoch" ]]; then
|
|
1192
|
+
printf '%s\n' $((now_epoch - started_epoch))
|
|
1193
|
+
return 0
|
|
1194
|
+
fi
|
|
1195
|
+
fi
|
|
1196
|
+
_setup_lock_dir_age_seconds "$lock_dir"
|
|
1197
|
+
return 0
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
_setup_pid_elapsed_seconds() {
|
|
1201
|
+
local pid="$1"
|
|
1202
|
+
local etime=""
|
|
1203
|
+
local first="" second="" third=""
|
|
1204
|
+
local days=0 hours=0 minutes=0 seconds=0
|
|
1205
|
+
[[ "$pid" =~ ^[0-9]+$ ]] || return 1
|
|
1206
|
+
etime=$(ps -p "$pid" -o etime= 2>/dev/null || true)
|
|
1207
|
+
etime="${etime//[[:space:]]/}"
|
|
1208
|
+
[[ -n "$etime" ]] || return 1
|
|
1209
|
+
IFS=':' read -r first second third <<<"$etime"
|
|
1210
|
+
if [[ -n "$third" ]]; then
|
|
1211
|
+
seconds="$third"
|
|
1212
|
+
minutes="$second"
|
|
1213
|
+
if [[ "$first" == *"-"* ]]; then
|
|
1214
|
+
days="${first%%-*}"
|
|
1215
|
+
hours="${first#*-}"
|
|
1216
|
+
else
|
|
1217
|
+
hours="$first"
|
|
1218
|
+
fi
|
|
1219
|
+
else
|
|
1220
|
+
minutes="$first"
|
|
1221
|
+
seconds="$second"
|
|
1222
|
+
fi
|
|
1223
|
+
if [[ "$days" =~ ^[0-9]+$ && "$hours" =~ ^[0-9]+$ && "$minutes" =~ ^[0-9]+$ && "$seconds" =~ ^[0-9]+$ ]]; then
|
|
1224
|
+
printf '%s\n' $((days * 86400 + hours * 3600 + minutes * 60 + seconds))
|
|
1225
|
+
return 0
|
|
1226
|
+
fi
|
|
1227
|
+
return 1
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1181
1230
|
_setup_register_child_pid() {
|
|
1182
1231
|
local pid="$1"
|
|
1183
1232
|
[[ -n "$pid" ]] || return 0
|
|
@@ -1286,6 +1335,16 @@ _setup_acquire_noninteractive_setup_lock() {
|
|
|
1286
1335
|
attempts=$((attempts + 1))
|
|
1287
1336
|
continue
|
|
1288
1337
|
fi
|
|
1338
|
+
local _owner_started_age=""
|
|
1339
|
+
local _owner_pid_age=""
|
|
1340
|
+
_owner_started_age=$(_setup_lock_started_age_seconds "$lock_dir" 2>/dev/null || true)
|
|
1341
|
+
_owner_pid_age=$(_setup_pid_elapsed_seconds "$owner_pid" 2>/dev/null || true)
|
|
1342
|
+
if [[ "$_owner_started_age" =~ ^[0-9]+$ && "$_owner_pid_age" =~ ^[0-9]+$ && "$_owner_started_age" -gt 300 && "$_owner_started_age" -gt $((_owner_pid_age + 300)) ]]; then
|
|
1343
|
+
print_warning "Removing stale setup.sh --non-interactive lock at ${lock_dir}; lock age ${_owner_started_age}s is older than owner pid ${owner_pid} runtime ${_owner_pid_age}s"
|
|
1344
|
+
rm -rf "$lock_dir" 2>/dev/null || true
|
|
1345
|
+
attempts=$((attempts + 1))
|
|
1346
|
+
continue
|
|
1347
|
+
fi
|
|
1289
1348
|
[[ -r "$lock_dir/command" ]] && owner_cmd=$(tr '\n' ' ' <"$lock_dir/command" 2>/dev/null || true)
|
|
1290
1349
|
# Build actionable diagnostics: elapsed time since lock was acquired
|
|
1291
1350
|
# and the currently-executing setup stage from the timing log.
|