Class: Sunshine::Nginx

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

Overview

Simple server wrapper for nginx setup and control.

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

Returns a new instance of Nginx.



8
9
10
11
12
13
14
15
16
# File 'lib/sunshine/daemons/nginx.rb', line 8

def initialize app, options={}
  super

  @supports_rack      = false
  @supports_passenger = true

  @dep_name = options[:dep_name] ||
    use_passenger? ? 'passenger-nginx' : 'nginx'
end

Instance Method Details

#start_cmdObject



19
20
21
# File 'lib/sunshine/daemons/nginx.rb', line 19

def start_cmd
  "#{@bin} -c #{self.config_file_path}"
end