Class: Sunshine::MongrelRails

Inherits:
Server show all
Defined in:
lib/sunshine/daemons/mongrel_rails.rb

Overview

Simple wrapper around mongrel setup and commands. For clustering, look at using Sunshine’s ServerCluster method, e.g.:

MongrelRails.new_cluster 10, app, :port => 5000

Note: This is a rails-only server, implemented for compatibility with older non-rack rails applications. Consider upgrading your application to run on rack and/or thin.

Note: Mongrel only supports a single log file. The default stdout file is used.

Constant Summary

Constants inherited from Daemon

Daemon::RESTART_FAILED_CODE, Daemon::START_FAILED_CODE, Daemon::STATUS_DOWN_CODE, Daemon::STOP_FAILED_CODE

Instance Attribute Summary

Attributes inherited from Server

#cluster, #connections, #port, #server_name, #sigkill, #target

Attributes inherited from Daemon

#app, #bin, #config_file, #config_path, #config_template, #name, #pid, #processes, #restart_cmd, #server_apps, #status_cmd, #stop_cmd, #sudo, #timeout

Instance Method Summary collapse

Methods inherited from Server

binder_methods, new_cluster, passenger_root, #setup, #supports_passenger?, #supports_rack?, #use_passenger?

Methods inherited from Daemon

#_restart_cmd, #_start_cmd, #_status_cmd, #_stop_cmd, binder_methods, #chown_log_files, #config_binding, #config_file_path, #config_template_files, #configure_remote_dirs, #each_server_app, #exit_on_failure, #has_setup?, #log_file, #log_files, #pick_sudo, #register_after_user_script, #restart, #setup, short_name, #start, #status, #stop, underscore, #upload_config_files

Constructor Details

#initialize(app, options = {}) ⇒ MongrelRails

Returns a new instance of MongrelRails.



17
18
19
20
21
22
23
24
# File 'lib/sunshine/daemons/mongrel_rails.rb', line 17

def initialize app, options={}
  super

  @dep_name = options[:dep_name] || "mongrel"

  @supports_rack      = false
  @supports_passenger = false
end

Instance Method Details

#start_cmdObject



27
28
29
30
# File 'lib/sunshine/daemons/mongrel_rails.rb', line 27

def start_cmd
  "cd #{@app.current_path} && mongrel_rails start "+
    "-C #{self.config_file_path}"
end