Module: PhusionPassenger::AdminTools

Defined in:
lib/phusion_passenger/admin_tools.rb,
lib/phusion_passenger/admin_tools/memory_stats.rb,
lib/phusion_passenger/admin_tools/server_instance.rb

Defined Under Namespace

Classes: MemoryStats, ServerInstance

Class Method Summary collapse

Class Method Details

.process_is_alive?(pid) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
39
40
41
42
43
44
45
# File 'lib/phusion_passenger/admin_tools.rb', line 36

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

.tmpdirObject



27
28
29
30
31
32
33
34
# File 'lib/phusion_passenger/admin_tools.rb', line 27

def self.tmpdir
	["PASSENGER_TEMP_DIR", "PASSENGER_TMPDIR"].each do |name|
		if ENV.has_key?(name) && !ENV[name].empty?
			return ENV[name]
		end
	end
	return "/tmp"
end