Service Start Issues¶
Troubleshooting guide for services that won't start or keep restarting.
Overview¶
Common reasons services fail to start: - Missing dependencies - Configuration errors - Permission problems - Port conflicts - Resource constraints - Database connection failures
Quick Diagnostics¶
Check Service Status¶
Identifies which services are down.
View Service Errors¶
Shows recent errors.
Check Dependencies¶
Ensures prerequisites are running.
Common Problems¶
mb-rpcd Won't Start¶
Check database:
Check Redis:
Check socket directory:
sudo ls -lh /var/run/mailborder/
sudo mkdir -p /var/run/mailborder
sudo chown mailborder:mailborder /var/run/mailborder
sudo chmod 755 /var/run/mailborder
Check configuration:
mb-filter Won't Start¶
Check mb-rpcd:
Check Rspamd:
Check ClamAV:
Check port:
Database Connection Failed¶
Test connection:
Check credentials:
Verify database exists:
Verify permissions:
Fix permissions if needed:
sudo mysql -u root -p << EOF
GRANT ALL PRIVILEGES ON mailborder.* TO 'mailborder'@'localhost';
FLUSH PRIVILEGES;
EOF
Redis Connection Failed¶
Check service:
Test connection:
Check port:
Check configuration:
Permission Errors¶
Check file ownership:
sudo ls -lh /var/run/mailborder/
sudo ls -lh /var/log/mailborder/
sudo ls -lh /var/spool/mailborder/
Fix permissions:
sudo chown -R mailborder:mailborder /var/run/mailborder
sudo chown -R mailborder:mailborder /var/log/mailborder
sudo chown -R mailborder:mailborder /var/spool/mailborder
sudo chmod 755 /var/run/mailborder
sudo chmod 755 /var/log/mailborder
sudo chmod 750 /var/spool/mailborder
Port Already in Use¶
Check what's using port:
Kill conflicting process:
Or change port (if appropriate):
Disk Full¶
Check disk space:
Clean up:
# Logs
sudo mb-maintenance --cleanup-logs
# Quarantine
sudo mb-quarantine-cleanup
# Temporary files
sudo rm -rf /tmp/mbv6-*
sudo rm -rf /var/tmp/mbv6-*
Out of Memory¶
Check memory:
Check service memory limits:
Increase limits if needed:
Add:
Then:
File Descriptor Limit¶
Check current limit:
Increase if needed:
Add:
Service Keeps Restarting¶
Check restart status:
View restart history:
Disable auto-restart temporarily:
Add:
Diagnose issue, then re-enable.
Step-by-Step Recovery¶
Complete Service Restart¶
-
Stop all services:
-
Check dependencies:
-
Clear runtime files:
-
Start infrastructure:
-
Start Mailborder:
-
Verify:
From Scratch Recovery¶
If services completely broken:
-
Backup configuration:
-
Stop everything:
-
Check for remnants:
-
Verify database:
-
Verify Redis:
-
Start core services:
-
Start Mailborder:
-
Verify:
Prevention¶
Regular Monitoring¶
Add to cron:
Script content:
#!/bin/bash
if ! sudo mb-status > /dev/null 2>&1; then
echo "Mailborder services issue detected" | \
mail -s "Service Alert" admin@example.com
sudo mb-services restart
fi
Health Checks¶
Daily checks:
Log Rotation¶
Ensure logs don't fill disk:
Regular Restarts¶
Schedule weekly maintenance restart: