etcdmain: trigger embed.Etcd.Close for OS interrupt

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyu-Ho Lee
2017-04-14 19:49:31 -07:00
parent 0d52598fc1
commit ea5f6dab6b

View File

@@ -187,7 +187,7 @@ func startEtcd(cfg *embed.Config) (<-chan struct{}, <-chan error, error) {
if err != nil {
return nil, nil, err
}
osutil.RegisterInterruptHandler(e.Server.Stop)
osutil.RegisterInterruptHandler(e.Close)
select {
case <-e.Server.ReadyNotify(): // wait for e.Server to join the cluster
case <-e.Server.StopNotify(): // publish aborted from 'ErrStopped'