News for hackers. Stuff that matters.

Shell Monitoring Script

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 | on HN )
Re:Shell Monitoring Script by mrsareen on Monday December 21, 2020 @06:04AM (#25493827)
There is a automatic restart option in systemctl that solves this exact issue -

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

Re:Shell Monitoring Script by spicyramen on Monday December 21, 2020 @04:50PM (#25500038)
Thank you very much!