¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Running w/ Bash Scripts, C++, & Watchdogs


 

¿ªÔÆÌåÓý


Hi Brendan,

I¡¯ve done many of the tasks that would be required to make such a monitoring system, but not roll my own. ?But that gets a little off topic for the group. ?You might want to consider signals instead of watching a file. ?Send a user defined signal to your bash monitor. ?Have the bash program trap for that custom signal. ?Also have a timer like functionality to ensure you¡¯ve received the custom signal within a defined heartbeat period. If you haven¡¯t received it, then force the restart, wait for a defined warm up time, and then wait for the heartbeat again. ?Of course, you¡¯d want to setup the os (linux) to ensure your monitor is always running and restart of not.

mark

On Dec 14, 2023, at 3:47 PM, Brendan Lydon <blydon12@...> wrote:

Mark,

Thank you for the swift suggestion. I thought it would be cool to write my own, which I have pretty much done already just working out the kinks, but that 'immortal python' looks cool. I also thought about using the subprocess module with python and still might as I have worked with that extensively.

Ideally, I wanted to use this as an exercise to improve my linux/bash scripting and do it all from scratch as it definitely seems doable. So, I kind of want to do it all from my .sh file and work with loops and such. Have you ever developed something similar in bash?

Thanks,
Brendan


Join [email protected] to automatically receive all group messages.