BTW, I’ve integrated systemd sd_notify() watchdog support here which includes an automatic restart option: GitHub - tim-seoss/emonhub at emon-pi-systemd - if you’d like to test it.
See separate thread - RFC - systemd integration with watchdog support and restart on thread failure
Tim.