Shell Monitoring Script

1 points by spicyramen ↗ HN
I have a service (Jupyter) that crashes now and then and the Data scientist need to reboot their machines or login via SSH and restart it. I was thinking in adding a service (shell) that keeps monitoring the service status and after X amount of continuos failures restart it. Is it a good pattern or seems hacky? most of the time service crashes because OOM. (Shell script may run systemctl and check for service status)

2 comments

[ 1.9 ms ] story [ 13.3 ms ] thread
There is a automatic restart option in systemctl that solves this exact issue -

[Service] Restart=on-failure RestartSec=5s