From 6f7fea49df10b934379e3e46c89336d6a6675a37 Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Thu, 8 Aug 2013 15:48:50 -0700 Subject: [PATCH] Fix pidfile creation/deletion race on jruby daemonization --- lib/puma/single.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/puma/single.rb b/lib/puma/single.rb index 1486583d..52a8846f 100644 --- a/lib/puma/single.rb +++ b/lib/puma/single.rb @@ -52,7 +52,11 @@ module Puma Signal.trap "SIGUSR2" do log "* Started new process #{pid} as daemon..." - exit + + # Must use exit! so we don't unwind and run the ensures + # that will be run by the new child (such as deleting the + # pidfile) + exit! end Signal.trap "SIGCHLD" do