docs: function(opts, done) {
    debug('starting!');
  
    var bin = path.join(__dirname, '..', 'bin', 'mongodb-runner-worker.js');
  
    var args = [
      '--name=' + opts.name,
      '--dbpath=' + opts.dbpath,
      '--logpath=' + opts.logpath,
      '--port=' + opts.port,
      '--topology=' + opts.topology,
      '--mongodBin=' + opts.mongodBin,
      '--mongosBin=' + opts.mongosBin,
      '--purge=' + opts.purge,
      '--auth_mechanism=' + opts.auth_mechanism
    ];
  
    if (opts.bin) {
      args.push('--bin=' + opts.bin);
    }
  
    if (
      opts.auth_mechanism === 'MONGODB-CR' ||
      opts.auth_mechanism === 'SCRAM-SHA-1'
    ) {
      args.push('--username=' + opts.username);
      args.push('--password=' + opts.password);
    }
  
    if (opts.storageEngine) {
      args.push('--storage_engine=' + opts.storageEngine);
    }
  
    if (opts.topology === 'replicaset') {
      args.push.apply(args, [
        '--arbiters=' + opts.arbiters,
        '--passives=' + opts.passives,
        '--secondaries=' + opts.secondaries
      ]);
  
      if (opts.auth_mechanism !== 'none') {
        args.push('--keyFile=' + opts.keyFile);
      }
    }
  
    if (opts.topology === 'cluster') {
      args.push.apply(args, [
        '--shards=' + opts.shards,
        '--mongoses=' + opts.mongoses,
        '--configs=' + opts.configs,
        '--shardPort=' + opts.shardPort,
        '--configPort=' + opts.configPort,
        '--arbiters=' + opts.arbiters,
        '--passives=' + opts.passives,
        '--secondaries=' + opts.secondaries
      ]);
  
      if (opts.auth_mechanism !== 'none') {
        args.push('--keyFile=' + opts.keyFile);
      }
    }
    /*
     * TODO (imlucas) Switch `killIfRunning` to `startIfNotRunning`
     * so you can bring up a replicaset/cluster when testing
     * and just leave it running in the background.
     */
    async.waterfall(
      [
        killIfRunning.bind(null, opts),
        function(cb) {
          debug('forking worker `%s` with args `%j`', bin, args);
          var proc = childProcess.fork(bin, args);
          proc.on('message', function onMessage(d) {
            debug('got messsage from worker', d);
            if (!d.event) {
              throw new TypeError(
                'Unknown message from worker ' + JSON.stringify(d, null, 2)
              );
            }
            if (d.event === 'started') {
              setupAuthentication(opts, function() {
                cb(null, proc.pid);
              });
            }
          });
          proc.on('error', cb);
          debug('forked proc with pid', proc.pid);
          debug('waiting for error or message from forked worker...');
        },
        function(pid, cb) {
          getPIDPath(opts, function(err, pidPath) {
            if (err) {
              return cb(err);
            }
            cb(null, pid, pidPath);
          });
        },
        function(pid, pidPath, cb) {
          debug('Writing pid %d to', pid, pidPath);
          fs.writeFile(pidPath, pid, cb);
        }
      ],
      done
    );
  }