Abhishek Kumar Mishra writes that he created a background bash script to automate service monitoring and self-healing on his Raspberry Pi Zero 2 W. The script is scheduled via systemd to check the status of Docker, Pi-Hole, Unbound, and Tailscale at regular intervals, restarting failed services without requiring manual SSH intervention. It acts as an additional protection layer beyond Docker's built-in restart policies and only triggers a system reboot when multiple checks fail.
- The script was generated using ChatGPT and selected over a Gemini output because it included appropriate delays between checks.
- Lightweight approach is preferred on the Zero 2 W because heavier tools like Uptime Kuma or Grafana consume too many resources.
- The script saves logs to a file, providing a baseline for further troubleshooting when manual intervention is still required.