Module: Signal

Defined in:
lib/phusion_passenger/utils.rb

Class Method Summary collapse

Class Method Details

.list_trappableObject

Like Signal.list, but only returns signals that we can actually trap.



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/phusion_passenger/utils.rb', line 555

def self.list_trappable
	ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
	case ruby_engine
	when "ruby"
		result = Signal.list
		result.delete("ALRM")
		result.delete("VTALRM")
	when "jruby"
		result = Signal.list
		result.delete("QUIT")
		result.delete("ILL")
		result.delete("FPE")
		result.delete("KILL")
		result.delete("SEGV")
		result.delete("USR1")
	else
		result = Signal.list
	end
	
	# Don't touch SIGCHLD no matter what! On OS X waitpid() will
	# malfunction if SIGCHLD doesn't have a correct handler.
	result.delete("CLD")
	result.delete("CHLD")
	
	# Other stuff that we don't want to trap no matter which
	# Ruby engine.
	result.delete("STOP")
	
	return result
end