lib/signals.js
function signals() {

  /**
   *  Signal handler.
   */
  function interrupt(signal) {
    this.log.notice('received %s, scheduling shutdown', signal);
    this.shutdown(0, process.exit);
  }

  interrupt = interrupt.bind(this);

  function iterate(signal) {

    /* test environment listener leak */
    if(process.listeners(signal).length) return;

    process.once(signal, function() {
      interrupt(signal);
    })
  }

  ['SIGINT', 'SIGTERM'].forEach(iterate.bind(this));
}
function signals() {

  /**
   *  Signal handler.
   */
  function interrupt(signal) {
    this.log.notice('received %s, scheduling shutdown', signal);
    this.shutdown(0, process.exit);
  }

  interrupt = interrupt.bind(this);

  function iterate(signal) {

    /* test environment listener leak */
    if(process.listeners(signal).length) return;

    process.once(signal, function() {
      interrupt(signal);
    })
  }

  ['SIGINT', 'SIGTERM'].forEach(iterate.bind(this));
}
function signals ( ) { /**
   *  Signal handler.
   */ function interrupt ( signal ) { this . log . notice ( 'received %s, scheduling shutdown' , signal ) ; this . shutdown ( 0 , process . exit ) ; } interrupt = interrupt . bind ( this ) ; function iterate ( signal ) { /* test environment listener leak */ if ( process . listeners ( signal ) . length ) return ; process . once ( signal , function ( ) { interrupt ( signal ) ; } ) } [ 'SIGINT' , 'SIGTERM' ] . forEach ( iterate . bind ( this ) ) ; }
Register listeners for signals that trigger a shutdown.
Register listeners for signals that trigger a shutdown .