On Jul 31, 1:56 pm, Frederick Cheung <[email protected]> wrote: > On Jul 31, 4:16 am, Anthony Burns <[email protected]> wrote: > > > Hello all, > > > Is there a way to restart a Rails app from a controller? I'm trying to > > make it so that, in the backend, administrators can add plugins/themes/ > > etc. to the running application without the need to actually go in to > > the server and restart the app. My first thought on this would be to > > just have the app restart on the next request after say, a plugin was > > activated. Has anyone done this before, or am I not taking the right > > approach? > > well there's no builtin way of doing this, but i don't see why you > couldn't shell out and `monit restart ...` (assuming monit was > controlling your processes, replace as appropriate depending on your > deploying (eg touch tmp/restart.txt for passenger). > it's not very nice but would probably work. The obvious downside I can > think of is that if the administrator doesn't have shell access to the > server they could completely screw themselves without being able to > fix it (eg accidentally add a plugin that is broken or incompatible > with the app or the version of rails used) > > Fred
Hmm... Doing it via the shell isn't really an option. The touch tmp/ restart.txt way is the only way I can figure out so far that I can call from the controller. I don't want to require the user to use any monitoring apps or anything outside the application. I'm trying to make it as easy as possible for the user to install plugins, custom permalinks, etc. without requiring them to manually restart the app. Now the tmp/restart.txt method would work on mod_rails but there's still people out there using other server technologies that I'd need to do something different? Cheers, SPC Anthony Burns Wisconsin ARNG --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

