mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcd-agent: enable GOFAIL_HTTP endpoint
This commit is contained in:
parent
ab6f49dc67
commit
8d4701bb1d
@ -68,6 +68,7 @@ func newAgent(etcd, logDir string) (*Agent, error) {
|
||||
// start starts a new etcd process with the given args.
|
||||
func (a *Agent) start(args ...string) error {
|
||||
a.cmd = exec.Command(a.cmd.Path, args...)
|
||||
a.cmd.Env = []string{"GOFAIL_HTTP=:2381"}
|
||||
a.cmd.Stdout = a.logfile
|
||||
a.cmd.Stderr = a.logfile
|
||||
err := a.cmd.Start()
|
||||
@ -119,16 +120,7 @@ func stopWithSig(cmd *exec.Cmd, sig os.Signal) error {
|
||||
|
||||
// restart restarts the stopped etcd process.
|
||||
func (a *Agent) restart() error {
|
||||
a.cmd = exec.Command(a.cmd.Path, a.cmd.Args[1:]...)
|
||||
a.cmd.Stdout = a.logfile
|
||||
a.cmd.Stderr = a.logfile
|
||||
err := a.cmd.Start()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
a.state = stateStarted
|
||||
return nil
|
||||
return a.start(a.cmd.Args[1:]...)
|
||||
}
|
||||
|
||||
func (a *Agent) cleanup() error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user