Commit f08bac90 authored by Lei Li's avatar Lei Li
Browse files

feat: 提供kill子进程的接口

parent 544ad0ec
......@@ -288,7 +288,7 @@ func (m *MonitorDaemon) runWithSignal(sigs []os.Signal) {
if isAlive && m.isProcAbnormalCallback != nil {
isAbnormal := m.isProcAbnormalCallback()
if isAbnormal {
m.killProcess()
m.KillProcess()
}
}
......@@ -297,7 +297,7 @@ func (m *MonitorDaemon) runWithSignal(sigs []os.Signal) {
}
}
func (m *MonitorDaemon) killProcess() {
func (m *MonitorDaemon) KillProcess() {
pid := m.childPid
if pid != 0 {
childExec := getProcExec(fmt.Sprintf("%d", pid))
......@@ -314,7 +314,7 @@ func (m *MonitorDaemon) killProcess() {
l.Errorf("killProcess child process kill SIGTERM error: %v", err)
}
} else {
l.Errorf("killProcess child process exec is not exist, pid: %d, exec:%s, cmdline: %s", m.childPid, childExec, m.cmdline)
l.Warnf("killProcess child process exec is not exist, pid: %d, exec:%s, cmdline: %s", m.childPid, childExec, m.cmdline)
}
} else {
l.Errorf("killProcess child process pid is not exist, pid: %d, cmdline: %s", m.childPid, m.cmdline)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment