Files
ctrld/cmd/cli/reload_others.go
T

22 lines
447 B
Go

//go:build !windows
package cli
import (
"os"
"os/signal"
"syscall"
)
// notifyReloadSigCh sends reload signal to the channel
func notifyReloadSigCh(ch chan os.Signal) {
signal.Notify(ch, syscall.SIGUSR1)
}
func stopNotifyReloadSigCh(ch chan os.Signal) { signal.Stop(ch) }
// sendReloadSignal sends a reload signal to the current process
func (p *prog) sendReloadSignal() error {
return syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
}