Spaces:
Runtime error
Runtime error
File size: 1,014 Bytes
64cdec8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#!/usr/bin/env bash
# Function to handle cleanup on script exit
cleanup() {
echo "Cleaning up processes..."
# Kill all background jobs
jobs -p | xargs -r kill
wait
echo "All processes stopped."
exit 0
}
# Set up signal handlers for graceful shutdown
trap cleanup SIGINT SIGTERM EXIT
echo "Starting all services in parallel..."
# Start all services in the background
echo "Starting frontend..."
unmute/dockerless/start_frontend.sh &
FRONTEND_PID=$!
echo "Starting backend..."
unmute/dockerless/start_backend.sh &
BACKEND_PID=$!
echo "Starting LLM service..."
unmute/dockerless/start_llm.sh &
LLM_PID=$!
echo "Starting STT service..."
unmute/dockerless/start_stt.sh &
STT_PID=$!
echo "Starting TTS service..."
unmute/dockerless/start_tts.sh &
TTS_PID=$!
# Store all PIDs for monitoring
PIDS="$FRONTEND_PID $BACKEND_PID $LLM_PID $STT_PID $TTS_PID"
echo "All services started with PIDs: $PIDS"
echo "Press Ctrl+C to stop all services"
# Wait for all background processes
wait |