Skip to content

Instantly share code, notes, and snippets.

@Olefine
Created July 12, 2013 07:52
Show Gist options
  • Select an option

  • Save Olefine/5982649 to your computer and use it in GitHub Desktop.

Select an option

Save Olefine/5982649 to your computer and use it in GitHub Desktop.
tasks for faye server with thin
namespace :faye_server do
desc "Start faye server"
task :start do
run "cd #{current_path};RAILS_ENV=production bundle exec rackup faye.ru -s thin -E production -D -P tmp/pids/faye.pid"
end
desc "Stop faye server"
task :stop do
run "cd #{current_path};if [ -f tmp/pids/faye.pid ] && [ -e /proc/$(cat tmp/pids/faye.pid) ]; then kill -9 `cat tmp/pids/faye.pid`; fi"
end
desc "Restart faye server"
task :restart do
stop
start
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment