Thin server start/stop/restart


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. namespace :server do
  2. desc "restart server"
  3. task :restart do
  4. system "thin restart -C /etc/thin/#{server_name}.yml"
  5. end
  6.  
  7. desc "stop server"
  8. task :stop do
  9. system "thin stop -C /etc/thin/#{server_name}.yml"
  10. end
  11.  
  12. desc "start server"
  13. task :start do
  14. system "thin start -C /etc/thin/#{server_name}.yml"
  15. end
  16.  
  17. def server_name
  18. File::basename(Rails.root)
  19. end
  20. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.