Merge branch '21678-installer-diagnostics-internal'. Closes #21678
[arvados.git] / lib / boot / supervisor.go
index abec2b0f4a0046919dfadfa182dadce4924ee2f6..67649e75de55132692767184e05cbb932b5f97e1 100644 (file)
@@ -111,7 +111,7 @@ func (super *Supervisor) Start(ctx context.Context) {
        super.ctx, super.cancel = context.WithCancel(ctx)
        super.done = make(chan struct{})
 
-       sigch := make(chan os.Signal)
+       sigch := make(chan os.Signal, 1)
        signal.Notify(sigch, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
        go func() {
                defer signal.Stop(sigch)
@@ -204,15 +204,24 @@ func (super *Supervisor) Wait() error {
 func (super *Supervisor) startFederation(cfg *arvados.Config) {
        super.children = map[string]*Supervisor{}
        for id, cc := range cfg.Clusters {
-               super2 := *super
                yaml, err := json.Marshal(arvados.Config{Clusters: map[string]arvados.Cluster{id: cc}})
                if err != nil {
                        panic(fmt.Sprintf("json.Marshal partial config: %s", err))
                }
-               super2.ConfigYAML = string(yaml)
-               super2.ConfigPath = "-"
-               super2.children = nil
-
+               super2 := &Supervisor{
+                       ConfigPath:           "-",
+                       ConfigYAML:           string(yaml),
+                       SourcePath:           super.SourcePath,
+                       SourceVersion:        super.SourceVersion,
+                       ClusterType:          super.ClusterType,
+                       ListenHost:           super.ListenHost,
+                       ControllerAddr:       super.ControllerAddr,
+                       NoWorkbench1:         super.NoWorkbench1,
+                       NoWorkbench2:         super.NoWorkbench2,
+                       OwnTemporaryDatabase: super.OwnTemporaryDatabase,
+                       Stdin:                super.Stdin,
+                       Stderr:               super.Stderr,
+               }
                if super2.ClusterType == "test" {
                        super2.Stderr = &service.LogPrefixer{
                                Writer: super.Stderr,
@@ -220,7 +229,7 @@ func (super *Supervisor) startFederation(cfg *arvados.Config) {
                        }
                }
                super2.Start(super.ctx)
-               super.children[id] = &super2
+               super.children[id] = super2
        }
 }
 
@@ -357,7 +366,6 @@ func (super *Supervisor) runCluster() error {
                runNginx{},
                railsDatabase{},
                runServiceCommand{name: "controller", svc: super.cluster.Services.Controller, depends: []supervisedTask{railsDatabase{}}},
-               runServiceCommand{name: "git-httpd", svc: super.cluster.Services.GitHTTP},
                runServiceCommand{name: "health", svc: super.cluster.Services.Health},
                runServiceCommand{name: "keepproxy", svc: super.cluster.Services.Keepproxy, depends: []supervisedTask{runPassenger{src: "services/api"}}},
                runServiceCommand{name: "keepstore", svc: super.cluster.Services.Keepstore},
@@ -812,7 +820,6 @@ func (super *Supervisor) autofillConfig() error {
        for _, svc := range []*arvados.Service{
                &super.cluster.Services.Controller,
                &super.cluster.Services.DispatchCloud,
-               &super.cluster.Services.GitHTTP,
                &super.cluster.Services.Health,
                &super.cluster.Services.Keepproxy,
                &super.cluster.Services.Keepstore,
@@ -830,7 +837,6 @@ func (super *Supervisor) autofillConfig() error {
                        }
                        host := net.JoinHostPort(defaultExtHost, port)
                        if svc == &super.cluster.Services.Controller ||
-                               svc == &super.cluster.Services.GitHTTP ||
                                svc == &super.cluster.Services.Health ||
                                svc == &super.cluster.Services.Keepproxy ||
                                svc == &super.cluster.Services.WebDAV ||
@@ -845,7 +851,7 @@ func (super *Supervisor) autofillConfig() error {
                if super.NoWorkbench1 && svc == &super.cluster.Services.Workbench1 ||
                        super.NoWorkbench2 && svc == &super.cluster.Services.Workbench2 ||
                        !super.cluster.Containers.CloudVMs.Enable && svc == &super.cluster.Services.DispatchCloud {
-                       // When workbench1 is disabled, it gets an
+                       // When Workbench is disabled, it gets an
                        // ExternalURL (so we have a valid listening
                        // port to write in our Nginx config) but no
                        // InternalURLs (so health checker doesn't