Forum OpenACS Q&A: Re: Can someone recommend a good way to watch the server?

Looking at the scripts the cron job basically makes a http request and if the server doesn't respond restarts it.

But what I need is
- to check if server has crashed and restart it
- to restart server after a given period

I will try to extend this script.

Do I need daemontools for this?

Hi Nima,

what is the significant difference in your opinion of not responding and crashing? A server that is not responding needs to be restarted.

If you use daemontools (which is required and anyone not using it or something alike is digging their own grave IMO), a crashed server will be restarted automatically, though this wont help you if the server is continuously running, but not responding (for whatever the reason). Thats what keepalive is for.

If you want to restart the server every morning at 4am, write into the crontab "* 4 * * * svc -dku /service/yoursite" (maybe there is a start missing.).

If you want to restart it after not responding for some time edit /keepalive-cron.sh and play with the wget parameters.