Module: PhusionPassenger::Utils

Included in:
AbstractRequestHandler, AbstractServer, AbstractServerCollection, AnalyticsLogger, ClassicRails::ApplicationSpawner, ClassicRails::ApplicationSpawner, ClassicRails::FrameworkSpawner, MessageClient, Rack::ApplicationSpawner, Rack::ApplicationSpawner, SpawnManager, WSGI::ApplicationSpawner
Defined in:
lib/phusion_passenger/utils.rb,
lib/phusion_passenger/utils/tmpdir.rb,
lib/phusion_passenger/utils/rewindable_input.rb,
lib/phusion_passenger/utils/hosts_file_parser.rb,
lib/phusion_passenger/utils/unseekable_socket.rb,
lib/phusion_passenger/utils/file_system_watcher.rb

Overview

Utility functions.

Defined Under Namespace

Classes: FileSystemWatcher, HostsFileParser, PseudoIO, RewindableInput, UnseekableSocket

Class Method Summary collapse

Class Method Details

.process_is_alive?(pid) ⇒ Boolean

Checks whether the given process exists.

Returns:

  • (Boolean)


502
503
504
505
506
507
508
509
510
511
# File 'lib/phusion_passenger/utils.rb', line 502

def process_is_alive?(pid)
	begin
		Process.kill(0, pid)
		return true
	rescue Errno::ESRCH
		return false
	rescue SystemCallError => e
		return true
	end
end