mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tools/etcd-agent: stop etcd only if it is running
Stop etcd only if it is running, and not report error when stopping etcd which is not started.
This commit is contained in:
parent
9a33678878
commit
097a56fe01
@ -73,6 +73,9 @@ func (a *Agent) start(args ...string) error {
|
||||
|
||||
// stop stops the existing etcd process the agent started.
|
||||
func (a *Agent) stop() error {
|
||||
if a.state != stateStarted {
|
||||
return nil
|
||||
}
|
||||
err := a.cmd.Process.Kill()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user