syscall.Kill

This commit is contained in:
Gyu-Ho Lee 2016-03-22 00:17:38 -07:00
parent f1b19bd041
commit 4b2d090ad1
2 changed files with 4 additions and 2 deletions

View File

@ -384,7 +384,9 @@ func (t *transporterServer) Transfer(ctx context.Context, r *Request) (*Response
return nil, fmt.Errorf("nil command")
}
log.Printf("Stopping %s [PID: %d]", t.req.Database, t.pid)
ps.Kill(os.Stdout, false, ps.Process{Stat: ps.Stat{Pid: int64(t.pid)}})
if err := syscall.Kill(t.pid, syscall.SIGTERM); err != nil {
return nil, err
}
if t.logfile != nil {
t.logfile.Close()
}

View File

@ -136,7 +136,7 @@ func CommandFunc(cmd *cobra.Command, args []string) {
nreq.ZookeeperMyID = uint32(i + 1)
ep := globalFlags.AgentEndpoints[nreq.EtcdServerIndex]
log.Printf("[%s] %s to %s\n", req.Operation, req.Database, ep)
log.Printf("[%s] %s at %s\n", req.Operation, req.Database, ep)
conn, err := grpc.Dial(ep, grpc.WithInsecure())
if err != nil {
log.Printf("error %v when connecting to %s\n", err, ep)