exp/cmd/upbox: wait for all servers before starting shell

Change-Id: Id287107cfc00aeec85891c139f81d826ed18eed5
Reviewed-on: https://upspin-review.googlesource.com/9760
Reviewed-by: David Presotto <presotto@gmail.com>
diff --git a/cmd/upbox/main.go b/cmd/upbox/main.go
index 0ac8928..87c9bd4 100644
--- a/cmd/upbox/main.go
+++ b/cmd/upbox/main.go
@@ -296,6 +296,16 @@
 		}
 	}
 
+	// Wait for the other services to start.
+	for _, s := range cfg.Servers {
+		if s.addr == cfg.KeyServer {
+			continue
+		}
+		if err := waitReady(s.addr); err != nil {
+			return err
+		}
+	}
+
 	// Start a shell as the first user.
 	configFile, err = writeConfig("shell", cfg.Users[0].Name)
 	if err != nil {