2008/12/28 Tycon <[email protected]>: > > For people running the web app using paster http server (usually > behind a web server acting > as a reverse proxy), what kind of tool do you use to monitor your app > server (e.g. paster) ? > > I've heard of supervisor, daemontools etc, but for my purpose a simple > shell script which acts as a > parent process of python/paster and just restarts it when it dies is > sufficient. > > So, the script I came up with is : > > #!/bin/bash > test -f $2 && exit > echo $$ > $2 > trap 'kill $!; rm $2; exit' SIGTERM > while true; do $1 & wait; sleep 20; done
This looks fine although you could also try to fetch a page and make assertions on the response, to make sure your users are not getting a 500 for example. I would also add some logging, as you probably want to trace back when the server had to be restarted, maybe even with an email notification. This would be easier to do if the script was in Python :-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
