feat: support --abort for reload and suspend (#346)

This commit is contained in:
mzz
2023-11-14 16:26:33 +08:00
committed by GitHub
parent 7e57531f91
commit 9f7a49b81d
5 changed files with 39 additions and 1 deletions

View File

@ -35,6 +35,11 @@ var (
cmd.Help()
os.Exit(1)
}
if abort {
if f, err := os.Create(AbortFile); err == nil {
f.Close()
}
}
if err = syscall.Kill(pid, syscall.SIGUSR2); err != nil {
fmt.Println(err)
os.Exit(1)
@ -46,4 +51,5 @@ var (
func init() {
rootCmd.AddCommand(suspendCmd)
suspendCmd.PersistentFlags().BoolVarP(&abort, "abort", "a", false, "Abort established connections.")
}