1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-23 17:34:13 +03:00
traefik/pkg/server/socket_activation_unix.go
Julien Salleyron b7de043991
Support systemd socket-activation
Co-authored-by: Michael <michael.matur@gmail.com>
2024-06-25 16:30:04 +02:00

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]
}
}