From 262ad7228ad146749d8337a682e8486d38df76c2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 14 May 2014 20:05:55 +0000 Subject: warn about premature grandparent death on daemonization This may cause failures if some process nukes the grandparent too soon. --- lib/zbatery.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/zbatery.rb b/lib/zbatery.rb index 65c9d0c..a4d20e0 100644 --- a/lib/zbatery.rb +++ b/lib/zbatery.rb @@ -92,7 +92,11 @@ module Rainbows end if ready_pipe - ready_pipe.syswrite($$.to_s) + begin + ready_pipe.syswrite($$.to_s) + rescue => e + logger.warn("grandparent died too soon?: #{e.message} (#{e.class})") + end ready_pipe.close self.ready_pipe = nil end -- cgit v1.2.3-24-ge0c7