# File lib/phusion_passenger/abstract_server.rb, line 225 def stop if !started? raise ServerNotStarted, "Server is not started" end begin @owner_socket.write("x") rescue Errno::EPIPE end @owner_socket.close @owner_socket = nil File.unlink(@socket_filename) rescue nil # Wait at most 4 seconds for server to exit. If it doesn't do that, # we kill it forcefully with SIGKILL. if !Process.timed_waitpid(@pid, 4) Process.kill('SIGKILL', @pid) rescue nil Process.timed_waitpid(@pid, 1) end end