code: func openAPISockets() ([]net.Listener, error) {
  	listeners := []net.Listener{}
  
  	fds := systemdFDs(true) // Try to get the socket fds from systemd
  	if len(fds) > 0 {
  		if flagAPIServiceListenAddr != "" {
  			return nil, fmt.Errorf("started under systemd.socket(5), but --listen passed! Quitting.")
  		}
  
  		stderr.Printf("Listening on %d systemd-provided socket(s)\n", len(fds))
  		for _, fd := range fds {
  			l, err := net.FileListener(fd)
  			if err != nil {
  				return nil, errwrap.Wrap(fmt.Errorf("could not open listener"), err)
  			}
  			listeners = append(listeners, l)
  		}
  	} else {
  		if flagAPIServiceListenAddr == "" {
  			flagAPIServiceListenAddr = common.APIServiceListenAddr
  		}
  		stderr.Printf("Listening on %s\n", flagAPIServiceListenAddr)
  
  		l, err := net.Listen("tcp", flagAPIServiceListenAddr)
  		if err != nil {
  			return nil, errwrap.Wrap(fmt.Errorf("could not open tcp socket"), err)
  		}
  		listeners = append(listeners, l)
  	}
  
  	return listeners, nil
  }
docs: // Open API sockets based on command line parameters and
  // the magic environment variable from systemd
  //
  // see sd_listen_fds(3)