github.com/database64128/shadowsocks-go@v1.10.2-0.20240315062903-143a773533f1/cred/manager_unix.go (about)

     1  //go:build unix
     2  
     3  package cred
     4  
     5  import (
     6  	"os"
     7  	"os/signal"
     8  	"syscall"
     9  )
    10  
    11  func (m *Manager) registerSIGUSR1() {
    12  	go func() {
    13  		sigCh := make(chan os.Signal, 1)
    14  		signal.Notify(sigCh, syscall.SIGUSR1)
    15  		for range sigCh {
    16  			m.ReloadAll()
    17  		}
    18  	}()
    19  }