some changes

This commit is contained in:
2025-11-30 12:50:38 +02:00
parent 004bb7ef7f
commit c1e5fc90ee
9 changed files with 140 additions and 27 deletions

View File

@@ -41,12 +41,21 @@ var stopCmd = &cobra.Command{
}
if *optsStopCmd.Force {
slog.Debug("force stopping server by SIGKILL", slog.Int("pid", *optsStopCmd.PID))
proc.Signal(syscall.SIGKILL)
err = proc.Signal(syscall.SIGKILL)
if err != nil {
slog.Error("failed to reload process", slog.Int("pid", *optsReloadCmd.PID), slog.String("err", err.Error()))
} else {
slog.Debug("done")
}
} else {
slog.Debug("stopping server", slog.Int("pid", *optsStopCmd.PID))
proc.Signal(syscall.SIGTERM)
err = proc.Signal(syscall.SIGTERM)
if err != nil {
slog.Error("failed to reload process", slog.Int("pid", *optsReloadCmd.PID), slog.String("err", err.Error()))
} else {
slog.Debug("done")
}
}
slog.Debug("done")
},
}