Skip to content

Instantly share code, notes, and snippets.

@gjedeer
Created January 11, 2013 22:14
Show Gist options
  • Save gjedeer/4514423 to your computer and use it in GitHub Desktop.
Save gjedeer/4514423 to your computer and use it in GitHub Desktop.
Rails with configurable socket path
#!/usr/bin/env ruby
# Run me from scripts/
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'
require 'ruby_version_check'
require 'initializer'
require 'dispatcher'
file = "/tmp/redmine.socket"
if File.exist?(file)
File.unlink(file)
end
server = UNIXServer.new(file)
$stdin.reopen(server)
puts "* Process listening on socket #{file}"
load File.dirname(__FILE__) + '/../public/dispatch.fcgi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment