Add initial wait for health-monitor and use pkill -x.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2018-02-14 08:56:07 +00:00
parent df461c0d48
commit 9b2d2a203c
3 changed files with 21 additions and 6 deletions

View File

@@ -206,7 +206,7 @@ func Randomize(str string) string {
// KillProcess kills the process by name. pkill is used.
func KillProcess(name string) error {
output, err := exec.Command("pkill", fmt.Sprintf("^%s$", name)).CombinedOutput()
output, err := exec.Command("pkill", "-x", fmt.Sprintf("^%s$", name)).CombinedOutput()
if err != nil {
return fmt.Errorf("failed to kill %q - error: %v, output: %q", name, err, output)
}