Skip to content

Instantly share code, notes, and snippets.

@achamian
Created February 8, 2010 18:40
Show Gist options
  • Save achamian/298437 to your computer and use it in GitHub Desktop.
Save achamian/298437 to your computer and use it in GitHub Desktop.
require 'fileutils'
require 'active_support'
require 'commands/servers/base'
puts "=> Ctrl-C to shutdown listener"
tail_thread = tail(Pathname.new("#{File.expand_path(RAILS_ROOT)}/log/#{RAILS_ENV}.log").cleanpath)
trap(:INT) { exit }
begin
Process.start
ensure
tail_thread.kill if tail_thread
puts 'Exiting'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment