// Start starts the Sauce Connect Proxy.
504566
func (c *Connect) Start() error {
	c.cmd = exec.Command(c.Path, c.Args...)
	if c.UserName != "" {
		c.cmd.Args = append(c.cmd.Args, "--user", c.UserName)
	}
	if c.AccessKey != "" {
		c.cmd.Args = append(c.cmd.Args, "--api-key", c.AccessKey)
	}
	if c.SeleniumPort > 0 {
		c.cmd.Args = append(c.cmd.Args, "--se-port", strconv.Itoa(c.SeleniumPort))
	}
	if c.ExtraVerbose {
		c.cmd.Args = append(c.cmd.Args, "-vv")
	} else if c.Verbose {
		c.cmd.Args = append(c.cmd.Args, "-v")
	}
	if c.ExtraVerbose || c.Verbose {
		c.cmd.Stdout = os.Stdout
		c.cmd.Stderr = os.Stderr
	}
	if c.LogFile != "" {
		c.cmd.Args = append(c.cmd.Args, "--logfile", c.LogFile)
	}
	if c.QuitProcessUponExit && runtime.GOOS == "linux" {
		c.cmd.SysProcAttr = &syscall.SysProcAttr{
			// Deliver SIGTERM to process when we die.
			Pdeathsig: syscall.SIGTERM,
		}
	}

	dir, err := ioutil.TempDir("", "selenium-sauce-connect")
	if err != nil {
		return err
	}
	defer func() {
		os.RemoveAll(dir) // ignore error.
	}()

	var pidFilePath string
	if c.PIDFile != "" {
		pidFilePath = c.PIDFile
	} else {
		f, err := ioutil.TempFile("", "selenium-sauce-connect-pid.")
		if err != nil {
			return err
		}
		pidFilePath = f.Name()
		f.Close() // ignore the error.
	}

	// The path specified here will be touched by the proxy process when it is
	// ready to accept connections.
	readyPath := filepath.Join(dir, "ready")
	c.cmd.Args = append(c.cmd.Args, "--readyfile", readyPath)
	c.cmd.Args = append(c.cmd.Args, "--pidfile", pidFilePath)

	if err := c.cmd.Start(); err != nil {
		return err
	}

	// Wait for the Proxy to accept connections.
	var started bool
	for i := 0; i < 60; i++ {
		time.Sleep(time.Second)
		if _, err := os.Stat(readyPath); err == nil {
			started = true
			break
		}
	}
	if !started {
		c.Stop() // ignore error.
		return fmt.Errorf("proxy process did not become ready before the timeout")
	}
	return nil
}
770707
func (s *Server) Start() error {
	if len(s.getCommandLabels()) > 0 {
		s.updateLabels()
	}
	go s.heartbeat.Run()

	// If the server requested connections to it arrive over a reverse tunnel,
	// don't call Start() which listens on a socket, return right away.
	if s.useTunnel {
		return nil
	}
	return s.srv.Start()
}
807861
func (fos *FanOutSink) Start() {
	fos.errs = make(chan error, len(fos.sinks))
	fos.cancelled = make(chan struct{})

	for _, sink := range fos.sinks {
		go func(sink Sink) {
			for {
				select {
				case <-fos.cancelled:
					// stop handling requests!
					fos.errs <- nil
					return
				case store, ok := <-fos.stores:
					if !ok {
						// no more requests to handle
						fos.errs <- nil
						return
					}

					err := sink.Store(store.loc, store.data)
					if err != nil {
						fos.errs <- err
						return
					}
				}
			}
		}(sink)
	}
}
1272625
func (mfw *MockFW) Start(ctx context.Context, info map[string]string, timeout int) (bool, error) {
	log.LoggerWContext(ctx).Info("Sending SSO through mocked Firewall SSO")
	return true, nil
}
342541
func (s *Service) Start(ctx context.Context) error {
	return s.collectContainersAndDo(ctx, func(c *container.Container) error {
		if err := s.connectContainerToNetworks(ctx, c, false); err != nil {
			return err
		}
		return c.Start(ctx)
	})
}
1341928
func (rkq *RekeyQueueStandard) start(ctx context.Context) {
	go func() {
		for {
			select {
			case id := <-rkq.queue:
				if err := rkq.limiter.Wait(ctx); err != nil {
					rkq.log.Debug("Waiting on rate limiter for tlf=%v error: %v", id, err)
					return
				}
				rkq.config.KBFSOps().RequestRekey(context.Background(), id)
				func(id tlf.ID) {
					rkq.mu.Lock()
					defer rkq.mu.Unlock()
					delete(rkq.pendings, id)
				}(id)
			case err := <-ctx.Done():
				rkq.log.Debug("Rekey queue background routine context done: %v", err)
				return
			}
		}
	}()
}
1044969
func (x *XRaySpanSink) Start(cl *trace.Client) error {
	x.traceClient = cl

	xrayDaemon, err := net.ResolveUDPAddr("udp", x.daemonAddr)
	if err != nil {
		return err
	}
	conn, err := net.DialUDP("udp", nil, xrayDaemon)
	if err != nil {
		return err
	}
	x.conn = conn

	return nil
}
689712
func (s *Server) Start() (err error) {
	if s.Status {
		e := echo.New()
		e.Use(middleware.GzipWithConfig(middleware.GzipConfig{
			Level: 2,
		}))
		e.Use(middleware.Recover())

		// web panel
		e.GET("/", func(c echo.Context) error {
			return s.render(c, "assets/index.html", 1)
		})
		e.GET("/assets/js/all.min.js", func(c echo.Context) error {
			return s.render(c, "assets/assets/js/all.min.js", 2)
		})
		e.GET("/assets/css/app.css", func(c echo.Context) error {
			return s.render(c, "assets/assets/css/app.css", 3)
		})
		e.GET("/app/components/settings/index.html", func(c echo.Context) error {
			return s.render(c, "assets/app/components/settings/index.html", 1)
		})
		e.GET("/app/components/project/index.html", func(c echo.Context) error {
			return s.render(c, "assets/app/components/project/index.html", 1)
		})
		e.GET("/app/components/index.html", func(c echo.Context) error {
			return s.render(c, "assets/app/components/index.html", 1)
		})
		e.GET("/assets/img/logo.png", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/logo.png", 5)
		})
		e.GET("/assets/img/svg/github-logo.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/github-logo.svg", 4)
		})
		e.GET("/assets/img/svg/ic_arrow_back_black_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_arrow_back_black_48px.svg", 4)
		})
		e.GET("/assets/img/svg/ic_clear_white_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_clear_white_48px.svg", 4)
		})
		e.GET("/assets/img/svg/ic_menu_white_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_menu_white_48px.svg", 4)
		})
		e.GET("/assets/img/svg/ic_settings_black_48px.svg", func(c echo.Context) error {
			return s.render(c, "assets/assets/img/svg/ic_settings_black_48px.svg", 4)
		})

		//websocket
		e.GET("/ws", s.projects)
		e.HideBanner = true
		e.Debug = false
		go func() {
			log.Println(s.Parent.Prefix("Started on " + string(s.Host) + ":" + strconv.Itoa(s.Port)))
			e.Start(string(s.Host) + ":" + strconv.Itoa(s.Port))
		}()
	}
	return nil
}
37789
func (s *SSHServer) Start() {
	s.config.Logger.Info("Starting SSH server", "addr", s.config.Bind)
	s.reaper.SpawnFunc(s.listen)
}
14737
func (s *Server) Start(ctx context.Context) {
	go func() {
		defer s.Close()
		<-ctx.Done()
		logger := log.FromContext(ctx)
		logger.Info("I have to go...")
		logger.Info("Stopping server gracefully")
		s.Stop()
	}()

	s.startTCPServers()
	s.routinesPool.Go(func(stop chan bool) {
		s.listenProviders(stop)
	})
	s.routinesPool.Go(func(stop chan bool) {
		s.listenConfigurations(stop)
	})
	s.startProvider()
	s.routinesPool.Go(func(stop chan bool) {
		s.listenSignals(stop)
	})
}
888573
func (n *Node) Start(ctx context.Context) error {
	err := errNodeStarted

	n.startOnce.Do(func() {
		close(n.started)
		go n.run(ctx)
		err = nil // clear error above, only once.
	})
	return err
}
272883
func (k *KafkaSpanSink) Start(cl *trace.Client) error {
	producer, err := newConfiguredProducer(k.logger, k.brokers, k.config)
	if err != nil {
		return err
	}
	k.producer = producer
	return nil
}
1024775
func (fw *PaloAlto) Start(ctx context.Context, info map[string]string, timeout int) (bool, error) {
	if fw.Transport == "syslog" {
		log.LoggerWContext(ctx).Info("Sending SSO to PaloAlto using syslog")
		return fw.startSyslog(ctx, info, timeout)
	} else {
		log.LoggerWContext(ctx).Info("Sending SSO to PaloAlto using HTTP")
		return fw.startHttp(ctx, info, timeout)
	}
}
68996
func (sh *StreamHandler) Start() {
	sh.requests = make(map[*http.Request]chan []byte)
	sh.done = make(chan struct{})
	go sh.loop()
}
488519
func (config ManifoldConfig) start(context dependency.Context) (worker.Worker, error) {
	if err := config.Validate(); err != nil {
		return nil, errors.Trace(err)
	}

	var agent agent.Agent
	if err := context.Get(config.AgentName, &agent); err != nil {
		return nil, errors.Trace(err)
	}
	var apiConn api.Connection
	if err := context.Get(config.APICallerName, &apiConn); err != nil {
		return nil, errors.Trace(err)
	}
	facade, err := config.NewRemoteRelationsFacade(apiConn)
	if err != nil {
		return nil, errors.Trace(err)
	}

	w, err := config.NewWorker(Config{
		ModelUUID:                agent.CurrentConfig().Model().Id(),
		RelationsFacade:          facade,
		NewRemoteModelFacadeFunc: remoteRelationsFacadeForModelFunc(config.NewControllerConnection),
		Clock:                    clock.WallClock,
	})
	if err != nil {
		return nil, errors.Trace(err)
	}
	return w, nil
}
1357930
func (c *rawConnection) Start() {
	c.startGoroutine(c.readerLoop)
	c.startGoroutine(c.writerLoop)
	c.startGoroutine(c.pingSender)
	c.startGoroutine(c.pingReceiver)
}
328483
func (c *Client) Start() error {
	if err := c.Listen(); err != nil {
		return err
	}
	return c.Serve()
}