diff options
author | Eric Wong <normalperson@yhbt.net> | 2014-05-14 20:05:55 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2014-05-14 20:05:55 +0000 |
commit | 262ad7228ad146749d8337a682e8486d38df76c2 (patch) | |
tree | c6036a51a4e10da1d6ba9eb28890e4ab4a9a319a | |
parent | 4479008d47c846f194e9e50d49f103f27ff8956b (diff) | |
download | zbatery-262ad7228ad146749d8337a682e8486d38df76c2.tar.gz |
warn about premature grandparent death on daemonization
This may cause failures if some process nukes the grandparent too soon.
-rw-r--r-- | lib/zbatery.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |