Spaces:
Runtime error
Runtime error
# 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 |