def trap_signals
      Signal.trap('QUIT') { shut_down }
      Signal.trap('INT')  { shut_down }
      Signal.trap('TERM') { shut_down }
    end
def trap_signals
      Signal.trap('QUIT') { shut_down }
      Signal.trap('INT')  { shut_down }
      Signal.trap('TERM') { shut_down }
    end
Trap exit signals in order to shut down cleanly.