16552: boot: wait for child proc cleanup when shutting down.
[arvados.git] / lib / boot / supervisor.go
index 7e641c62dd4407a69f6fbf7b3eeb6ff2cd97e002..52cd0b16167a9d9f31767cb9ec4975c1eee1e8fc 100644 (file)
@@ -471,6 +471,7 @@ func (super *Supervisor) WaitReady() bool {
                        super.logger.Infof("waiting for %s to be ready", id)
                        if !super2.WaitReady() {
                                super.logger.Infof("%s startup failed", id)
+                               super.Stop()
                                return false
                        }
                        super.logger.Infof("%s is ready", id)
@@ -484,6 +485,7 @@ func (super *Supervisor) WaitReady() bool {
                select {
                case <-ticker.C:
                case <-super.ctx.Done():
+                       super.Stop()
                        return false
                }
                if super.healthChecker == nil {
@@ -848,7 +850,8 @@ func (super *Supervisor) autofillConfig() error {
                        }
                }
                if super.NoWorkbench1 && svc == &super.cluster.Services.Workbench1 ||
-                       super.NoWorkbench2 && svc == &super.cluster.Services.Workbench2 {
+                       super.NoWorkbench2 && svc == &super.cluster.Services.Workbench2 ||
+                       !super.cluster.Containers.CloudVMs.Enable && svc == &super.cluster.Services.DispatchCloud {
                        // When workbench1 is disabled, it gets an
                        // ExternalURL (so we have a valid listening
                        // port to write in our Nginx config) but no