This commit is contained in:
@@ -32,6 +32,17 @@ do_start() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Surface stray maestro processes the pidfile doesn't track (e.g. an orphaned
|
||||
# run on another port/mode that a previous restart never stopped). The
|
||||
# app-level worker lock (src/instance-lock.ts) will refuse to double-start
|
||||
# worker mode against the same DB, but warn here so the operator notices.
|
||||
local strays
|
||||
strays=$(pgrep -f "node dist/main.js" 2>/dev/null | grep -vx "$$" || true)
|
||||
if [[ -n "$strays" ]]; then
|
||||
echo "WARNING: other 'node dist/main.js' process(es) detected (PID: $(echo "$strays" | tr '\n' ' '))."
|
||||
echo " If a previous run was not stopped cleanly, stop it first to avoid port/DB conflicts."
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$LOG_FILE")"
|
||||
|
||||
echo "Checking runtime dependencies..."
|
||||
|
||||
Reference in New Issue
Block a user