Project

General

Profile

Bug #1565 ยป 0001-report-error-when-cannot-create-pid.patch

Lukas Zapletal, 04/02/2012 06:06 AM

View differences:

lib/sinatra-patch.rb
else
pid = "#{SETTINGS.daemon_pid}"
end
puts "Writing to #{pid}"
File.open(pid, 'w'){ |f| f.write(Process.pid) }
at_exit { File.delete(pid) if File.exist?(pid) }
begin
puts "Writing to #{pid}"
File.open(pid, 'w'){ |f| f.write(Process.pid) }
at_exit { File.delete(pid) if File.exist?(pid) }
rescue Exception => e
puts "== Error writing pid file #{pid}!"
end
end
handler.run self, {:Host => bind, :Port => port}.merge(@ssl_options) do |server|
[:INT, :TERM].each { |sig| trap(sig) {
    (1-1/1)