github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

adamhjk / mongrel_runit

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 10
    • 4
  • Source
  • Commits
  • Network (4)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Manage a mongrel cluster using runit — Read more

  cancel

http://wiki.hjksolutions.com/display/MR/Home

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

removing garbage from gemspec 
adamhjk (author)
Wed Sep 10 18:47:47 -0700 2008
commit  ad505f72332fea9f59ab3b5b86dae6ffc589cfe4
tree    88f84b2811b27748c8c728e35c82d41d8cddbde8
parent  8c2f575a2efb2395acbb210c34ee87dd72d1f028
mongrel_runit /
name age
history
message
file .gitignore Loading commit data...
file CHANGELOG.txt
file History.txt Tue Jul 24 02:11:28 -0700 2007 Initial commit [adamhjk]
file LICENSE Tue May 20 11:09:36 -0700 2008 Updating LICENSE to reflect GPL [adamhjk]
file Manifest.txt Tue Jul 24 02:11:28 -0700 2007 Initial commit [adamhjk]
file README.txt Sun Dec 09 21:07:05 -0800 2007 Updating mongrel_runit [adamhjk]
file Rakefile
directory bin/ Tue May 20 11:10:04 -0700 2008 Updating the bang-path to use env ruby [adamhjk]
directory examples/
directory lib/
file mongrel_runit.gemspec
file setup.rb
directory test/
README.txt
README for mongrel_runit
========================

This is a mongrel_cluster replacement using runit to control a set of mongrel
instances.  It provides all of the features inherent in services being
managed by runit, and knows how to check each running mongrel for status.

Debt of Gratitude
=================

Mongrel Runit was greatly inspired by mongrel_cluster, and some portions
of it are taken verbatim: particularly the code to construct a mongrel's
command line arguments.  

Requirements
============

1. Mongrel (gem install mongrel)
2. runit (http://smarden.org/runit/)

You will need to have runit installed, and the permissions on /etc/sv and
/var/service (or equivalents) be correct. (You will need to allow the
user running 'mongrel_runit create' to create the right directories)

Usage
=====

You will need to have the proper service directories created in order to
have them managed by mongrel_runit.  We handle that for you through:

    mongrel_runit create
    
This will read the configuration and create the proper number of mongrel
services.  If you change the configuration, either to alter the number
of running mongrels or anything else, simply run mongrel_runit create
again.  It knows what "should" be there, and will clean up after you.

Once that is done, you should be able to do:

    mongrel_runit stop|start|restart
    
For a full list of options, run mongrel_runit -h

Configuration
=============

We look for the configuration file in a number of different places.  With
no arguments at all, we assume that we are in a Rails applications base
directory already, with a:

    ./config/mongrel_runit.yml
    
            or
    
    ./config/mongrel_cluster.yml
    
File.  If we find one, we will load it and go to town.  If you are 
reusing a mongrel_cluster.yml file, you will likely need to specify
the "-a appname" argument.

YAML file options are identical to mongrel_cluster, and represent
options to mongrel_rails:

environment
port
address
log_file
cwd
timeout
mime_map
docroot
debug
config_script
user
group
prefix

Additional, mongrel_runit specific options are:

application_name: This is the "name" of your rails app. We use it to construct
    the actual name of the service directory.  So "foo" becomes 
    "mongrel-foo-port"

runit_sv_dir: Where to create the service directories.  Defaults to /etc/sv

runit_service_dir: Where to create the symlinks for runsvdir to pick up.
    Defaults to /var/service

check: A block of code that will become the check file.  By default, it is:

    #!/usr/bin/env ruby

    require 'net/http'

    http = Net::HTTP.new('#{address}', #{@config["port"].to_i})
    begin
      response = http.options('/')
      if response = Net::HTTPSuccess
        exit 0
      else 
        exit 1
      end
    rescue Errno::ECONNREFUSED
      exit 1
    end

    This will be created for each service, and used to report the final
    status when running "mongrel_runit start"

svlogd_config: Another code block, which sets up the log configuration.
    See the svlogd manpage for options.
    
base_log_directory: By default, your logs will wind up under each service
    directory in "log/main/current".  You can override this directory
    here.  If you do, each log will wind up in a subdirectory named after
    the service.  For example, setting base_log_directory to "/tmp" would
    create:
    
        /tmp/mongrel-appname-port/current
    
    For your logs.  Not a bad idea to set this to your applications "log"
    directory.
    
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server