#!/bin/bash echo "=== Backtesting Service Health Check ===" echo "" # Check process if ps -p 1739871 > /dev/null 2>&1; then echo "✓ Process Status: RUNNING (PID: 1739871)" echo " Uptime: $(ps -p 1739871 -o etime= | xargs)" else echo "✗ Process Status: NOT RUNNING" exit 1 fi # Check port if ss -tlnp 2>/dev/null | grep -q ":50052.*1739871"; then echo "✓ Port Status: LISTENING on 50052" else echo "✗ Port Status: NOT LISTENING" exit 1 fi # Check TLS handshake if timeout 2 openssl s_client -connect localhost:50052 -CAfile /tmp/foxhunt/certs/ca.crt &1 | grep -q "Verify return code: 0"; then echo "✓ TLS Status: HANDSHAKE OK" elif timeout 2 openssl s_client -connect localhost:50052 &1 | grep -q "CONNECTED"; then echo "⚠ TLS Status: CONNECTED (certificate validation pending)" else echo "✗ TLS Status: FAILED" fi # Check recent logs echo "" echo "=== Recent Log Entries ===" tail -5 /home/jgrusewski/Work/foxhunt/logs/backtesting_service.log echo "" echo "✓ Backtesting service is operational"