mirror of
				https://github.com/traefik/traefik.git
				synced 2025-11-04 10:21:15 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			541 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			541 B
		
	
	
	
		
			Go
		
	
	
	
	
	
//go:build !windows
 | 
						|
 | 
						|
package server
 | 
						|
 | 
						|
import (
 | 
						|
	"net"
 | 
						|
 | 
						|
	"github.com/coreos/go-systemd/activation"
 | 
						|
	"github.com/rs/zerolog/log"
 | 
						|
)
 | 
						|
 | 
						|
func populateSocketActivationListeners() {
 | 
						|
	listenersWithName, _ := activation.ListenersWithNames()
 | 
						|
 | 
						|
	socketActivationListeners = make(map[string]net.Listener)
 | 
						|
	for name, lns := range listenersWithName {
 | 
						|
		if len(lns) != 1 {
 | 
						|
			log.Error().Str("listenersName", name).Msg("Socket activation listeners must have one and only one listener per name")
 | 
						|
			continue
 | 
						|
		}
 | 
						|
 | 
						|
		socketActivationListeners[name] = lns[0]
 | 
						|
	}
 | 
						|
}
 |