// Start starts all long-running plugins.
357005
func (loader *PluginLoader) Start(iface coreiface.CoreAPI) error {
	for i, pl := range loader.plugins {
		if pl, ok := pl.(plugin.PluginDaemon); ok {
			err := pl.Start(iface)
			if err != nil {
				closePlugins(loader.plugins[i:])
				return err
			}
		}
	}
	return nil
}
526093
func (k *Driver) Start() (err error) {
	if err = k.connect(k); err != nil {
		return err
	}

	go k.listen(k)

	return
}
552712
func (s *fsResourceAnalyzer) Start() {
	s.startOnce.Do(func() {
		if s.calcPeriod <= 0 {
			klog.Info("Volume stats collection disabled.")
			return
		}
		klog.Info("Starting FS ResourceAnalyzer")
		go wait.Forever(func() { s.updateCachedPodVolumeStats() }, s.calcPeriod)
	})
}
1000740
func (darwin *darwinRecord) Start() (string, error) {
	startAction := "Starting " + darwin.description + ":"

	if ok, err := checkPrivileges(); !ok {
		return startAction + failed, err
	}

	if !darwin.isInstalled() {
		return startAction + failed, ErrNotInstalled
	}

	if _, ok := darwin.checkRunning(); ok {
		return startAction + failed, ErrAlreadyRunning
	}

	if err := exec.Command("launchctl", "load", darwin.servicePath()).Run(); err != nil {
		return startAction + failed, err
	}

	return startAction + success, nil
}
707924
func (m *monitor) Start(availablePlugins *availablePlugins) {
	//start a routine that will be fired every X duration looping
	//over available plugins and firing a health check routine
	ticker := time.NewTicker(m.duration)
	m.quit = make(chan struct{})
	go func() {
		for {
			select {
			case <-ticker.C:
				go func() {
					availablePlugins.RLock()
					for _, ap := range availablePlugins.all() {
						if !ap.IsRemote() {
							go ap.CheckHealth()
						}
					}
					availablePlugins.RUnlock()
				}()
			case <-m.quit:
				ticker.Stop()
				m.State = MonitorStopped
				return
			}
		}
	}()
	m.State = MonitorStarted
}
842399
func (b *PluginBackend) startBackend(ctx context.Context) error {
	pluginName := b.config.Config["plugin_name"]
	pluginType, err := consts.ParsePluginType(b.config.Config["plugin_type"])
	if err != nil {
		return err
	}

	// Ensure proper cleanup of the backend (i.e. call client.Kill())
	b.Backend.Cleanup(ctx)

	nb, err := bplugin.NewBackend(ctx, pluginName, pluginType, b.config.System, b.config, false)
	if err != nil {
		return err
	}
	err = nb.Setup(ctx, b.config)
	if err != nil {
		return err
	}

	// If the backend has not been loaded (i.e. still in metadata mode),
	// check if type and special paths still matches
	if !b.loaded {
		if b.Backend.Type() != nb.Type() {
			nb.Cleanup(ctx)
			b.Logger().Warn("failed to start plugin process", "plugin", b.config.Config["plugin_name"], "error", ErrMismatchType)
			return ErrMismatchType
		}
		if !reflect.DeepEqual(b.Backend.SpecialPaths(), nb.SpecialPaths()) {
			nb.Cleanup(ctx)
			b.Logger().Warn("failed to start plugin process", "plugin", b.config.Config["plugin_name"], "error", ErrMismatchPaths)
			return ErrMismatchPaths
		}
	}

	b.Backend = nb
	b.loaded = true

	return nil
}
173279
func (p *Plugin) Start(ctx context.Context) error {
	p.logInfo("Starting bundle downloader.")
	p.mtx.Lock()
	defer p.mtx.Unlock()
	p.downloader.Start(ctx)
	return nil
}
473944
func (m *podManager) Start(rundir string, localSubnetCIDR string, clusterNetworks []common.ClusterNetwork, serviceNetworkCIDR string, clearHostPorts bool) error {
	if m.enableHostports {
		iptInterface := utiliptables.New(utilexec.New(), utildbus.New(), utiliptables.ProtocolIpv4)
		m.hostportSyncer = kubehostport.NewHostportSyncer(iptInterface)
		if clearHostPorts {
			_ = m.hostportSyncer.SyncHostports(Tun0, nil)
		}
	}

	var err error
	if m.ipamConfig, err = getIPAMConfig(clusterNetworks, localSubnetCIDR); err != nil {
		return err
	}

	go m.processCNIRequests()

	m.cniServer = cniserver.NewCNIServer(rundir, &cniserver.Config{MTU: m.mtu, ServiceNetworkCIDR: serviceNetworkCIDR})
	return m.cniServer.Start(m.handleCNIRequest)
}
149055
func (c *client) Start(ctx context.Context, mysqldArgs ...string) error {
	return c.withRetry(ctx, func() error {
		_, err := c.c.Start(ctx, &mysqlctlpb.StartRequest{
			MysqldArgs: mysqldArgs,
		})
		return err
	})
}
1096000
func (s *Sessions) Start(ctx context.Context) *Session {
	cookieValue := s.decodeCookieValue(GetCookie(ctx, s.config.Cookie))

	if cookieValue == "" { // cookie doesn't exists, let's generate a session and add set a cookie
		sid := s.config.SessionIDGenerator()

		sess := s.provider.Init(sid, s.config.Expires)
		sess.isNew = s.provider.db.Len(sid) == 0

		s.updateCookie(ctx, sid, s.config.Expires)

		return sess
	}

	sess := s.provider.Read(cookieValue, s.config.Expires)

	return sess
}
286236
func (e *emitter) Start() {
	if !e.started {
		e.started = true
		e.wg.Add(1)
		go e.startEventListener(&e.wg)
	}
}
279502
func (config ManifoldConfig) start(context dependency.Context) (worker.Worker, error) {
	if err := config.Validate(); err != nil {
		return nil, errors.Trace(err)
	}

	var clock clock.Clock
	if err := context.Get(config.ClockName, &clock); err != nil {
		return nil, errors.Trace(err)
	}

	if config.RaftName != "" {
		// We don't need anything from raft directly, but if it's set
		// ensure it's running before continuing.
		if err := context.Get(config.RaftName, nil); err != nil {
			return nil, errors.Trace(err)
		}
	}

	cleanup := func() error { return nil }
	var updaterFunc func() (globalclock.Updater, error)
	if config.StateName != "" {
		var stTracker workerstate.StateTracker
		if err := context.Get(config.StateName, &stTracker); err != nil {
			return nil, errors.Trace(err)
		}
		statePool, err := stTracker.Use()
		if err != nil {
			return nil, errors.Trace(err)
		}
		cleanup = stTracker.Done
		updaterFunc = statePool.SystemState().GlobalClockUpdater
	} else {

		var updater globalclock.Updater
		if err := context.Get(config.LeaseManagerName, &updater); err != nil {
			return nil, errors.Trace(err)
		}
		updaterFunc = func() (globalclock.Updater, error) {
			return updater, nil
		}
	}

	worker, err := config.NewWorker(Config{
		NewUpdater:     updaterFunc,
		LocalClock:     clock,
		UpdateInterval: config.UpdateInterval,
		BackoffDelay:   config.BackoffDelay,
		Logger:         config.Logger,
	})
	if err != nil {
		cleanup()
		return nil, errors.Trace(err)
	}

	go func() {
		worker.Wait()
		cleanup()
	}()
	return worker, nil
}
1167339
func (d *DRV2605LDriver) Start() (err error) {
	if err := d.initialize(); err != nil {
		return err
	}
	return nil
}
929167
func (c *Container) Start(ctx context.Context) error {
	if c.Engine == nil {
		return ErrNilEngine
	}
	startCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
	defer cancel()
	return c.Engine.VirtualizationStart(startCtx, c.ID)
}
924019
func (config ManifoldConfig) start(context dependency.Context) (worker.Worker, error) {
	if err := config.Validate(); err != nil {
		return nil, errors.Trace(err)
	}
	var apiCaller base.APICaller
	if err := context.Get(config.APICallerName, &apiCaller); err != nil {
		return nil, errors.Trace(err)
	}
	facade, err := config.NewFacade(apiCaller)
	if err != nil {
		return nil, errors.Trace(err)
	}
	w, err := config.NewWorker(Config{
		Facade: facade,
	})
	if err != nil {
		return nil, errors.Trace(err)
	}
	return w, nil
}
850293
func (c *dockerLoggerClient) Start(opts *StartOpts) error {
	req := &proto.StartRequest{
		Endpoint:    opts.Endpoint,
		ContainerId: opts.ContainerID,
		StdoutFifo:  opts.Stdout,
		StderrFifo:  opts.Stderr,
		Tty:         opts.TTY,

		TlsCert: opts.TLSCert,
		TlsKey:  opts.TLSKey,
		TlsCa:   opts.TLSCA,
	}
	_, err := c.client.Start(context.Background(), req)
	return err
}
457838
func (rt *Runtime) StartREPL(ctx context.Context) {

	if err := rt.Manager.Start(ctx); err != nil {
		fmt.Fprintln(rt.Params.Output, "error starting plugins:", err)
		os.Exit(1)
	}

	defer rt.Manager.Stop(ctx)

	banner := rt.getBanner()
	repl := repl.New(rt.Store, rt.Params.HistoryPath, rt.Params.Output, rt.Params.OutputFormat, rt.Params.ErrorLimit, banner).WithRuntime(rt.info)

	if rt.Params.Watch {
		if err := rt.startWatcher(ctx, rt.Params.Paths, onReloadPrinter(rt.Params.Output)); err != nil {
			fmt.Fprintln(rt.Params.Output, "error opening watch:", err)
			os.Exit(1)
		}
	}

	repl.Loop(ctx)
}