mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03: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
|
||
|
}
|