Skip to content

Commit

Permalink
cmd: exit with 2 if server start failed (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
overvenus authored Dec 1, 2016
1 parent 6885ac5 commit 66ca769
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/pd-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func main() {
case flag.ErrHelp:
os.Exit(0)
default:
log.Errorf("parse cmd flags err %s\n", err)
os.Exit(2)
log.Fatalf("parse cmd flags err %s\n", err)
}

err = server.InitLogger(cfg)
Expand All @@ -54,13 +53,11 @@ func main() {

svr, err := server.CreateServer(cfg)
if err != nil {
log.Errorf("create pd server err %s\n", err)
return
log.Fatalf("create pd server err %s\n", err)
}
err = svr.StartEtcd(api.NewHandler(svr))
if err != nil {
log.Errorf("server start etcd failed - %v", errors.Trace(err))
return
log.Fatalf("server start etcd failed - %v", errors.Trace(err))
}

sc := make(chan os.Signal, 1)
Expand Down

0 comments on commit 66ca769

Please sign in to comment.