tailwatchd Integration¶
cPanel's tailwatchd daemon runs chkservd, which monitors services and automatically restarts them if they go down. Without proper integration, chkservd would restart Apache after you stop it — defeating the swap.
The Problem¶
By default, cPanel monitors Apache (httpd) via chkservd. If you stop Apache and start VeloServe, chkservd will restart Apache within a few minutes because it sees httpd as "down."
The Solution¶
The import-apache-and-swap.sh --swap script automatically handles this, but here is what it does under the hood.
Disable Apache Monitoring¶
Edit /etc/chkserv.d/chkservd.conf and set:
This tells chkservd to stop monitoring Apache and PHP-FPM.
Create VeloServe Health Check¶
Create /etc/chkserv.d/veloserve:
This tells chkservd to probe port 80 with an HTTP request and expect an HTTP/ response. If VeloServe does not respond, chkservd will restart it.
Enable VeloServe Monitoring¶
Add to /etc/chkserv.d/chkservd.conf:
Restart tailwatchd¶
This applies the new monitoring configuration immediately.
Verifying the Setup¶
Check monitoring status¶
Expected output after swap:
Check the health check file¶
Test auto-restart¶
# Kill VeloServe
systemctl stop veloserve
# Wait 30-60 seconds for chkservd to detect and restart
sleep 60
# Check if it came back
systemctl is-active veloserve
WHM Service Manager¶
VeloServe also registers with WHM's Service Manager during installation:
This allows WHM to display and manage VeloServe in WHM > Service Configuration > Service Manager.
Reverting¶
The --revert flag restores Apache monitoring:
This sets:
httpd:1(re-enable Apache monitoring)veloserve:0(disable VeloServe monitoring)- Starts Apache, stops VeloServe
- Restarts
tailwatchd
Manual Configuration¶
If you need to adjust the health check, edit /etc/chkserv.d/veloserve:
# Check a specific URL
service[veloserve]=80,GET /health HTTP/1.0\r\n\r\n,HTTP/
# Check HTTPS instead
service[veloserve]=443,GET / HTTP/1.0\r\n\r\n,HTTP/
After editing, restart tailwatchd:
Troubleshooting¶
Apache keeps coming back¶
- Check
chkservd.conf:grep httpd /etc/chkserv.d/chkservd.conf— should showhttpd:0 - Restart tailwatchd:
systemctl restart tailwatchd - Check for other services re-enabling Apache:
grep -r httpd /etc/chkserv.d/
VeloServe not being monitored¶
- Check
chkservd.conf:grep veloserve /etc/chkserv.d/chkservd.conf— should showveloserve:1 - Check health check file exists:
cat /etc/chkserv.d/veloserve - Test the health check manually:
curl -s http://localhost/ | head -1— should return HTTP response
Next Steps¶
- Apache Swap — the full swap process
- CLI Commands — service management commands
- Installation — initial setup