### Home Classes Methods

### In Files

- lib/phusion_passenger/standalone/start_command.rb

### Parent

Command

### Methods

- ::description
- ::new
- #run

### Class/Module Index

Quicksearch

- PhusionPassenger
- PhusionPassenger::AbstractInstaller
- PhusionPassenger::AbstractInstaller::Abort
- PhusionPassenger::AbstractInstaller::CommandError
- PhusionPassenger::AdminTools
- PhusionPassenger::AdminTools::MemoryStats
- PhusionPassenger::AdminTools::MemoryStats::Process
- PhusionPassenger::AdminTools::ServerInstance
- PhusionPassenger::AdminTools::ServerInstance::CorruptedDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::GenerationsAbsentError
- PhusionPassenger::AdminTools::ServerInstance::Group
- PhusionPassenger::AdminTools::ServerInstance::Process
- PhusionPassenger::AdminTools::ServerInstance::RoleDeniedError
- PhusionPassenger::AdminTools::ServerInstance::StaleDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::Stats
- PhusionPassenger::AdminTools::ServerInstance::UnsupportedGenerationStructureVersionError
- PhusionPassenger::AnalyticsLogger
- PhusionPassenger::AnalyticsLogger::Connection
- PhusionPassenger::AnalyticsLogger::Lock
- PhusionPassenger::AnalyticsLogger::Log
- PhusionPassenger::ClassicRails
- PhusionPassenger::ClassicRails::CGIFixed
- PhusionPassenger::ClassicRails::ThreadHandlerExtension
- PhusionPassenger::ConsoleTextTemplate
- PhusionPassenger::DebugLogging
- PhusionPassenger::LoaderSharedHelpers
- PhusionPassenger::MessageChannel
- PhusionPassenger::MessageChannel::InvalidHashError
- PhusionPassenger::MessageClient
- PhusionPassenger::NativeSupportLoader
- PhusionPassenger::Packaging
- PhusionPassenger::PlatformInfo
- PhusionPassenger::PlatformInfo::Depcheck
- PhusionPassenger::PlatformInfo::Depcheck::ConsoleRunner
- PhusionPassenger::PlatformInfo::Depcheck::Dependency
- PhusionPassenger::PlatformInfo::RuntimeError
- PhusionPassenger::Plugin
- PhusionPassenger::PreloaderSharedHelpers
- PhusionPassenger::Rack
- PhusionPassenger::Rack::OutOfBandGc
- PhusionPassenger::Rack::ThreadHandlerExtension
- PhusionPassenger::Rails3Extensions
- PhusionPassenger::Rails3Extensions::AnalyticsLogging
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ACExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ASBenchmarkableExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ExceptionLogger
- PhusionPassenger::RequestHandler
- PhusionPassenger::RequestHandler::ThreadHandler
- PhusionPassenger::RequestHandler::ThreadHandler::Interrupted
- PhusionPassenger::SharedConstants
- PhusionPassenger::Standalone
- PhusionPassenger::Standalone::AppFinder
- PhusionPassenger::Standalone::Command
- PhusionPassenger::Standalone::ConfigFile
- PhusionPassenger::Standalone::ConfigFile::DisallowedContextError
- PhusionPassenger::Standalone::HelpCommand
- PhusionPassenger::Standalone::Main
- PhusionPassenger::Standalone::PackageRuntimeCommand
- PhusionPassenger::Standalone::RuntimeInstaller
- PhusionPassenger::Standalone::StartCommand
- PhusionPassenger::Standalone::StatusCommand
- PhusionPassenger::Standalone::StopCommand
- PhusionPassenger::Standalone::Utils
- PhusionPassenger::Standalone::VersionCommand
- PhusionPassenger::Utils
- PhusionPassenger::Utils::AnsiColors
- PhusionPassenger::Utils::FileSystemWatcher
- PhusionPassenger::Utils::FileSystemWatcher::DirInfo
- PhusionPassenger::Utils::FileSystemWatcher::FileInfo
- PhusionPassenger::Utils::HostsFileParser
- PhusionPassenger::Utils::TeeInput
- PhusionPassenger::Utils::TmpIO
- PhusionPassenger::Utils::UnseekableSocket
- CommonLibraryBuilder
- Exception
- GC
- IO
- Object
- Signal

No matching classes.

# PhusionPassenger::Standalone::StartCommand

### Public Class Methods

description() click to toggle source

    # File lib/phusion_passenger/standalone/start_command.rb, line 42
    def self.description
            return "Start Phusion Passenger Standalone."
    end

new(args) click to toggle source

    # File lib/phusion_passenger/standalone/start_command.rb, line 46
    def initialize(args)
            super(args)
            @console_mutex = Mutex.new
            @termination_pipe = IO.pipe
            @threads = []
            @interruptable_threads = []
            @plugin = PhusionPassenger::Plugin.new('standalone/start_command', self, @options)
    end

### Public Instance Methods

run() click to toggle source

    # File lib/phusion_passenger/standalone/start_command.rb, line 55
    def run
            parse_my_options
            sanity_check_options

            @runtime_dirs = determine_runtime_dirs
            ensure_nginx_installed
            determine_various_resource_locations
            require_app_finder
            @app_finder = AppFinder.new(@args, @options)
            @apps = @app_finder.scan
            @plugin.call_hook(:found_apps, @apps)

            extra_controller_options = {}
            @plugin.call_hook(:before_creating_nginx_controller, extra_controller_options)
            create_nginx_controller(extra_controller_options)

            begin
                    start_nginx
                    show_intro_message
                    if @options[:daemonize]
                            if PlatformInfo.ruby_supports_fork?
                                    daemonize
                            else
                                    daemonize_without_fork
                            end
                    end
                    Thread.abort_on_exception = true
                    @plugin.call_hook(:nginx_started, @nginx)
                    ########################
                    ########################
                    watch_log_files_in_background if should_watch_logs?
                    wait_until_nginx_has_exited
            rescue Interrupt
                    stop_threads
                    stop_nginx
                    exit 2
            rescue SignalException => signal
                    stop_threads
                    stop_nginx
                    if signal.message == 'SIGINT' || signal.message == 'SIGTERM'
                            exit 2
                    else
                            raise
                    end
            rescue Exception => e
                    stop_threads
                    stop_nginx
                    raise
            ensure
                    stop_threads
            end
    ensure
            if @temp_dir
                    FileUtils.remove_entry_secure(@temp_dir) rescue nil
            end
            @plugin.call_hook(:cleanup)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.