Created
January 11, 2013 22:14
-
-
Save gjedeer/4514423 to your computer and use it in GitHub Desktop.
Rails with configurable socket path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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