Class: Sunshine::Unicorn

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

Overview

Simple server wrapper for Unicorn setup and control. Unicorn is strictly a backend server and therefore does not support the :point_to proxying option.

Direct Known Subclasses

Rainbows

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 = {}) ⇒ Unicorn

Returns a new instance of Unicorn.



10
11
12
13
14
15
16
17
# File 'lib/sunshine/daemons/unicorn.rb', line 10

def initialize app, options={}
  super

  @timeout = options[:timeout] || 3.0

  @supports_rack      = true
  @supports_passenger = false
end

Instance Method Details

#start_cmdObject



20
21
22
23
# File 'lib/sunshine/daemons/unicorn.rb', line 20

def start_cmd
  "cd #{@app.current_path} && #{@bin} -D -E #{@app.deploy_env} "+
    "-p #{@port} -c #{self.config_file_path};"
end