code: func Start(ctx context.Context, rootDir, stateDir string, opts ...DaemonOpt) (Daemon, error) {
  	r := &remote{
  		rootDir:  rootDir,
  		stateDir: stateDir,
  		Config: config.Config{
  			Root:  filepath.Join(rootDir, "daemon"),
  			State: filepath.Join(stateDir, "daemon"),
  		},
  		pluginConfs:   pluginConfigs{make(map[string]interface{})},
  		daemonPid:     -1,
  		logger:        logrus.WithField("module", "libcontainerd"),
  		daemonStartCh: make(chan error, 1),
  		daemonStopCh:  make(chan struct{}),
  	}
  
  	for _, opt := range opts {
  		if err := opt(r); err != nil {
  			return nil, err
  		}
  	}
  	r.setDefaults()
  
  	if err := system.MkdirAll(stateDir, 0700, ""); err != nil {
  		return nil, err
  	}
  
  	go r.monitorDaemon(ctx)
  
  	select {
  	case <-time.After(startupTimeout):
  		return nil, errors.New("timeout waiting for containerd to start")
  	case err := <-r.daemonStartCh:
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	return r, nil
  }
docs: // Start starts a containerd daemon and monitors it