postrank-labs / goliath

Goliath is a non-blocking Ruby web server framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restart the server by touching some file

guiocavalcanti opened this issue · comments

Any ideias how can I restart a Goliath server by touching some file (for example, tmp/restart.txt)?

Why do you need to restart? For configuration re-load or for code changes? If it's for configuration reload (and you aren't on windows) if you send a HUP to Goliath it will reload the config.

Otherwise, there is currently no facility in Goliath for restarting on file touch. You're best bet is to run a processes watcher (like God or Bluepill) and have them restart Goliath when you need something updated.

Actually I'd like to restart by touching because it's easy to deploy on engineyard that way. Using the nginx + passenger stack (most of the people do) they simply touch the restart.txt file and passenger takes care of restarting the applications.

I'll try to do that through monit then. Thanks anyway :)

You could use something like eventmachine-tail to setup a callback which would listen for a touched file and do the HUP / reload. Shouldn't be hard to add.. would be a nice feature. Having said that, if you can "touch" a file, chances you can send a HUP signal?

@igrigorik, really nice ideia for a feature. I'll try to do that and pull request you. Is it ok?

please do!