mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-22 22:17:51 +08:00
16 lines
256 B
Go
16 lines
256 B
Go
package caddycmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
"strconv"
|
|
)
|
|
|
|
func gracefullyStopProcess(pid int) error {
|
|
cmd := exec.Command("taskkill", "/pid", strconv.Itoa(pid))
|
|
if err := cmd.Run(); err != nil {
|
|
return fmt.Errorf("taskkill: %v", err)
|
|
}
|
|
return nil
|
|
}
|