1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
// +build !windows package caddycmd import ( "fmt" "syscall" ) func gracefullyStopProcess(pid int) error { err := syscall.Kill(pid, syscall.SIGINT) if err != nil { return fmt.Errorf("kill: %v", err) } return nil }