enable consul webgui on :18500
[arvados.git] / services / boot / supervisor.go
index 9ac2532c8fdf32b0e060cd7cca7c3a262dfd39a0..a8d8a8c5148d59444ad173219f0e5ee0ee7f1b6e 100644 (file)
@@ -28,9 +28,10 @@ func newSupervisor(ctx context.Context, name, cmd string, args ...string) superv
        }
 }
 
+// supervised by systemd/runit/etc and registered with consul
 type supervisedService struct {
-       name string
-       cmd  string
+       name string             // name to register with consul
+       cmd  string             // program to run (absolute path)
        args []string
 }
 
@@ -72,3 +73,7 @@ func (s *supervisedService) Boot(ctx context.Context) error {
                Port: availablePort(),
        })
 }
+
+func availablePort() int {
+       return rand.Intn(10000) + 20000
+}