Add log file close and reopen on receipt of SIGUSR1
This commit is contained in:
parent
64b8fc52c3
commit
4e5fcac9cb
12 changed files with 343 additions and 25 deletions
26
server/server_signals_windows.go
Normal file
26
server/server_signals_windows.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
// +build windows
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"github.com/containous/traefik/log"
|
||||
)
|
||||
|
||||
func (server *Server) configureSignals() {
|
||||
signal.Notify(server.signals, syscall.SIGINT, syscall.SIGTERM)
|
||||
}
|
||||
|
||||
func (server *Server) listenSignals() {
|
||||
for {
|
||||
sig := <-server.signals
|
||||
switch sig {
|
||||
default:
|
||||
log.Infof("I have to go... %+v", sig)
|
||||
log.Info("Stopping server")
|
||||
server.Stop()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue