code: func (agent *Agent) configureSwarmingAutoStart(ctx context.Context, server string) error {
  	if err := os.MkdirAll(agent.swarmingBotDir, 0755); err != nil {
  		return err
  	}
  	if err := agent.strategy.chown(ctx, agent.swarmingUser, agent.swarmingBotDir); err != nil {
  		return err
  	}
  
  	path := filepath.Join(agent.swarmingBotDir, "swarming_bot.zip")
  	if err := agent.downloadSwarmingBotCode(ctx, server, path); err != nil {
  		return err
  	}
  
  	substitutions := map[string]string{
  		"Path": path,
  		"User": agent.swarmingUser,
  	}
  	content, err := substituteAsset(ctx, agent.swarmingAutoStartTemplate, substitutions)
  	if err != nil {
  		return err
  	}
  	path, err = substitute(ctx, agent.swarmingAutoStartPath, substitutions)
  	if err != nil {
  		return err
  	}
  	_, err = os.Stat(path)
  	switch {
  	case err == nil:
  		logging.Infof(ctx, "Reinstalling: %s.", path)
  	case os.IsNotExist(err):
  		logging.Infof(ctx, "Installing: %s.", path)
  	default:
  		return err
  	}
  	if err := ioutil.WriteFile(path, []byte(content), 0644); err != nil {
  		return err
  	}
  	return agent.strategy.enableSwarming(ctx)
  }
docs: // configureSwarmingAutoStart configures auto-connect to the given Swarming server on reboot.