github.com/sohaha/zlsgo@v1.7.13-0.20240501141223-10dd1a906f76/znet/signal_notwin.go (about)

     1  //go:build !windows
     2  // +build !windows
     3  
     4  package znet
     5  
     6  import (
     7  	"os"
     8  	"syscall"
     9  )
    10  
    11  // Restart Restart
    12  func (e *Engine) Restart() error {
    13  	pid := os.Getpid()
    14  	proc, err := os.FindProcess(pid)
    15  	if err != nil {
    16  		return err
    17  	}
    18  	return proc.Signal(syscall.SIGUSR2)
    19  }