mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 21:53:48 +03:00
15 lines
256 B
Go
15 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
|
|
}
|