def handle_errors
      trap('HUP')  { }
      trap('TERM') { close_log; Process.exit! }
      trap('KILL') { close_log; Process.exit! }
      trap('INT')  { close_log; Process.exit! }
    end
def handle_errors
      trap('HUP')  { }
      trap('TERM') { close_log; Process.exit! }
      trap('KILL') { close_log; Process.exit! }
      trap('INT')  { close_log; Process.exit! }
    end
Trap certain signals so the Client can report back the progress of the
 job and close the log.