Troubleshooting: Background Processes
Common issues with background processes.
Problem: Background Process Not Starting
Symptom: Process doesn't start or immediately exits.
Solution 1: Check Port Availability
# Check if port is available
lsof -i :3000 # macOS/Linux
netstat -ano | findstr :3000 # Windows
Solution 2: Check Log Files
# View recent logs
tail -f ~/.projax/logs/process-*.log
Solution 3: Run in Foreground First
# Remove -M flag to see errors
prx 1 dev
Problem: Background Process Not Stopping
Symptom: prx stop doesn't stop the process.
Solution 1: Force Kill
# Get PID
prx ps
# Force kill
kill -9 <pid> # macOS/Linux
taskkill /F /PID <pid> # Windows
Solution 2: Check Process File
# Check processes file
cat ~/.projax/processes.json
Solution 3: Clean Process File
# Remove processes file (will be recreated)
rm ~/.projax/processes.json
Problem: Logs Not Appearing
Symptom: No log files created.
Solution 1: Check Log Directory
# Ensure directory exists
ls -la ~/.projax/logs/
Solution 2: Check Permissions
# Check permissions
ls -la ~/.projax/
# Fix if needed
chmod 755 ~/.projax/logs/
Solution 3: Verify Process is Running
# Check if process actually started
prx ps
# Check system processes
ps aux | grep <project-name>
Problem: Too Many Background Processes
Symptom: Many processes running, system slow.
Solution: Stop All Processes
# Get all PIDs
prx ps
# Stop each
prx stop <pid1>
prx stop <pid2>
# ... etc
Solution: Clean Old Logs
# Remove logs older than 7 days
find ~/.projax/logs/ -name "*.log" -mtime +7 -delete
Problem: Process Shows as Running But Isn't
Symptom: prx ps shows process, but it's not actually running.
Solution: Clean Process File
# Remove and recreate
rm ~/.projax/processes.json
# Processes file will be recreated on next use
Related Documentation
- Background Process Examples - Usage examples
- CLI Commands - Process management commands