如何杀死子进程?
我有一个长时间运行的应用程序,使用“exec.命令“:
// ...I am a long running application in the background
// Now I am starting a child process, that should be killed togeter with the parent application.
cmd := exec.Command("sh", "-c", execThis)
// create a new process group
// cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
现在,如果我杀死它就不会杀死子进程 - 你知道怎么做吗?<pid of long running application in the background>
12345678_0001
相关分类