title: How to kill all servers running in gulp using one bash command
body: <p>I have created a <code>gulpfile.js</code> to start my servers, and its content can be seen below. </p>
  
  <pre><code>gulp.task('default', function () {
      if(!fs.statSync('/etc/aptly.conf').isFile()){
      process.exit();
      return;
      }
  
      console.info('Starting static file server SimpleHTTPServer on 0.0.0.0:8080');
      aptly_static = spawn('python', ['-m', 'SimpleHTTPServer', '8080'], {'cwd': '/opt/aptly/public', 'stdio': 'inherit'});
  
      console.info('Starting Django runserver on 0.0.0.0:8000');
      django = spawn('python', ['manage.py', 'runserver', '0.0.0.0:8000'], {'stdio': 'inherit'});
  
      console.info('Starting Aptly api serve on 0.0.0.0:4416');
      aptly_api = run('aptly api serve -listen="0.0.0.0:4416"').exec().pipe(gulp.dest('/tmp/aptlylog'));
  
      return watchLess('src/**/*.less')
      .pipe(debug())
          .pipe(reLess)
          .pipe(gulp.dest('dist/dist'));
  </code></pre>
  
  <p>The problem is if less preprocessor crashes for any reason, the gulpfile.js daemon exits poorly. The child processes <code>python manage.py runserver</code> <code>python -m SimpleHTTPServer</code> <code>aptly api serve</code> will still be running. </p>
  
  <p>I have had to painstakingly terminate these by using a <code>ps -aux | grep runserver</code> and similar to find the PID to delete via <code>sudo kill -9 $PID</code>. </p>
  
  <p>Is there a way to directly kill all the processes if my gulpfile.js crashes unexpectedly? </p>