mirror of
https://github.com/containous/traefik.git
synced 2024-12-23 17:34:13 +03:00
b7de043991
Co-authored-by: Michael <michael.matur@gmail.com>
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]
|
|
}
|
|
}
|